Free Essay

Pt1420 Unit 2

In:

Submitted By jt1827
Words 676
Pages 3
Short Answers
1. What does a professional programmer usually do first to gain an understanding of a problem? The first thing a professional programmer will usually do to gain the understanding of a problem is to work directly with, and interview the customer.
2. What is pseudocode? Pseudocode is an informal language that has no syntax rules, and is not meant to be compiled or executed.
3. Computer programs typically perform what three steps? 1) Input is received. 2) Some process is performed on the input. 3) Output is produced.
4. What does the term “user-friendly” mean? "User friendly" means that the software or device is easy to use, and that the person using it won't have a hard time learning how to use it or have problems while using it.

Algorithm Workbench
1. Design an algorithm that prompts the user to enter his or her height and stores the user’s input in a variable named height. 1. Get the user to input their height. 2. Store user height as a variable named height
2. Design an algorithm that prompts the user to enter his or her favorite color and stores the user’s input in a variable named color. 1. Get the user to input their favorite color. 2. Store user color as a variable named color

Programing Exercises
1. Personal Information
Display “Enter your name”
Input name
Display “Enter your address, with city, state, and zip”
Input address, with city, state, and zip
Display “Enter your telephone number”
Input telephone number
Display “Enter your college major”
Input college major

4. Total Purchase
Display “Enter the first item”
Input Item 1
Display “Enter the second item”
Input Item 2
Display “Enter the third item”
Input Item 3
Display “Enter the forth item”
Input Item 4
Display “Enter the fifth item”
Input item 5
Set subtotal = item1+item2+item3+item4+item5
Set sales tax = (subtotal*.06)
Set total = subtotal + sales tax
Display “Your Subtotal is”, subtotal, “The sales tax is”, sales tax, “Your total is”, total

Unit 2 Research 1
Java
1. Variable names are case-sensitive.
2. A variable’s name can be any legal identifier.
3. It can contain Unicode letter, Digits and Two Special Characters such as Underscore and dollar Sign.
4. Length of Variable name can be any number.
5. Its necessary to use Alphabet at the start (however we can use underscore , but do not use it )
6. Some auto generated variables may contain ‘$‘ sign. But try to avoid using Dollar Sign.
7. White space is not permitted.
8. Special Characters are not allowed.
9. Digit at start is not allowed.
10. Subsequent characters may be letters, digits, dollar signs, or underscore characters.
11. Variable name must not be a keyword or reserved word.

Visual Basics
1. You must use a letter as the first character.
2. You can't use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name.
3. Name can't exceed 255 characters in length.
4. Generally, you shouldn't use any names that are the same as the functions, statements, and methods in Visual Basic. You end up shadowing the same keywords in the language. To use an intrinsic language function, statement, or method that conflicts with an assigned name, you must explicitly identify it. Precede the intrinsic function, statement, or method name with the name of the associated type library. For example, if you have a variable called Left, you can only invoke the Left function using VBA.Left .
5. You can't repeat names within the same level of scope. For example, you can't declare two variables named age within the same procedure. However, you can declare a private variable named age and a procedure-level variable named age within the same module.
Python
1. Must begin with a letter (a - z, A - B) or underscore (_)
2. Other characters can be letters, numbers or _
3. Case Sensitive
4. Can be any (reasonable) length
5. There are some reserved words which you cannot use as a variable name because Python uses them for other things.

Similar Documents

Premium Essay

Pt1420 Unit 2 Research

...Kelli Okuly PT1420 Unit 2 Research Assignment 12-5-2014 Variable naming conventions vary from program to program. In Visual Basic the variable must begin with a letter and you cannot use a space, period (.), or the characters !, @, &, $, # in the name. Visual Basic variable names must be under 255 characters long. You shouldn't use any names that are the same as the functions, statements, and methods in Visual Basic. You end up shadowing the same keywords in the language. To use a basic language function, statement, or method that conflicts with an assigned name, you must explicitly identify it. Precede the fundamental function, statement, or method name with the name of the associated type library. For example, if you have a variable called “Left”, you can only use the “Left” function using “VBA.Left”. In Python, variables must begin with a letter or underscore (_). Other characters can be letters, numbers, or the underscore. Python variables are case sensitive and can be any length, within reason. There are several keywords in Python that are reserved for other functions and cannot be used as variables. For example; print, def, from, not, and return. Variables in Java are referred to as Identifiers. In Java the variable must begin with a letter, an underscore, or a dollar sign ($) although a letter is typically what is used. The other characters may be letters or numbers, no spaces or special characters are allowed. Java identifiers can be any length within...

Words: 405 - Pages: 2

Premium Essay

Pt1420 Unit 2 Assignment

...groups. Make sure that kids have different partners than they did in the activities of before. Give each group of kids a list of foods from each of the five food groups sections on the My Plate plate. Hand out two inch squares of white construction paper to each group. Have each student, use crayons to draw 10 foods from their food group. Display the food drawings in different area of the classroom. Explain to the kids that their next task is to shop for healthy foods and create a meal that is both nutritionally balanced and delicious in their eyes. That the purpose of this activity is to plan a meal they can have at home with their family. This activity is the planning part of setting a goal for eating healthy delicious meal. Hand out 2 blank plates to each student. Let the kids “shop” in the classroom, choosing foods for their plate and glueing them on. Have kids show their meal to a neighbor. Explain to kids that their job is to take the plates home and share them with thier parents and that maybe tapeing the plates to the refrigerator would be a good idea. Core Concepts and learning target / Goal Setting Children will make a food plan for reaching the goal of eating a balanced...

Words: 1219 - Pages: 5

Premium Essay

Pt1420 Unit 2 Assignment

...the dots. As the space increase between the dots,the displacement(metres) increases as well. This tells us that the object under accelerated motion is covering the grounds in each time segment equally. 2. I feel that we use the line of best fit in order to avoid the errors that can occur while we are graphing. When we add our data to the table, we may have made a few mistakes which can change our analysis drastically so when we use the line of best fit we can see if our data is going in the pattern trend that we have planned out. If the line of best fit is avoiding some points that means our plan could be wrong or that we have a data that’s different...

Words: 538 - Pages: 3

Premium Essay

Pt1420 Unit 2 Essay

...the contrary, Mrs. Downey should receive full medical care and compensatory damages for her injuries. She will prevail in court as the innocent victim of lack of good judgment (twins and their parents) and negligence per se (hotel). However, on a personal note, one can say that when children grow without rules, there is nothing that will stop them from doing wherever they please. Therefore, the innkeeper could not do anything to prevent this incident. Finally, they long winding slides that turn and twists were the attractive nuisance that draw the attention of the twins and ignore the swimming pool rules. However the hotel managers should remembers that in swimming pools they should exercise a Higher Duty of Care Owed to Children. Question 2: There is no doubt that both guests will prevail in court and the Respondent Superior Doctrine should be their best ally. Fortunately, they did not contribute in any manner to cause this fire. Also they could not prevent it, considering that they ignored the fact that Mr. Evers, the maintenance engineer was performing poorly and his lack of professionalism will serve the victims to probe that the Ray established Contributory Negligence when exercising his duties poorly. Therefore there are no grounds to make good use of the Comparative Liability Clause. Furthermore, the innkeeper is liable, because its managers also failed to hire a reliable, professional, and responsible engineer. Moreover, everything points that he was not very well trained...

Words: 1700 - Pages: 7

Premium Essay

Pt1420 Unit 2 Assignment

...She demonstrates the ability to conserve number and subitize up to ten. Lillian is able to count by 1’s, 2’s, 10’s and continues to work on counting by 5’s. She has developed mental math strategies that help her solve addition and subtraction facts up to 20. Lillian is comfortable with power of ten, power of nine, doubles and count on/back as well as using a number line as an aid. She is able to voice her thinking aloud for example, when asked to solve 9+5, she said, “If there was a 10 it would be 15 but it’s a 9 so take 1 away and you get 14”. When others share their reasoning Lillian actively listens and shows respects thus demonstrating character in learning. Lillian continues to work on carefully looking at the operation as she has mixed them up. When solving for a missing addend, Lillian is able to use a number line but may require a reminder...

Words: 633 - Pages: 3

Free Essay

Itt Technical Institute Pt1420 Unit 2

...David Camacho PT1420 Programming Lab 2.1 Display Welcome to the Fiber Optic Calculator Program. Enter company name. Enter the number of fiber optic cable needed. Multiply .87 times the feet needed for the total cost. Display the total cost of the fiber optic cable and the company name. Purpose of Variable | Variable Name | Stores cost of fiber | fiberCost | Stores the company name | firstChoice | Stores the number of feet to be installed | 50 | Stores the calculated cost of installed fiber | .87 | Display “Welcome to the Fiber Optic Calculator Program” Set fiberCost = .87 Display “What is the company name?” Input companyName Display “How many feet of fiber will be installed” Input feetInstalled Set totalCost = fiberCost * feetInstalled Display “For the company” , companyName, “the total cost will be $” , totalCost David Camacho PT1420 Lab 2.2 Flowchart David Camacho PT1420 Programming Lab 2.3 Visual Studios Program David Camacho Unit 2 HW Assignment 1 Short Answer 1.What does a professional programmer usually do first to gain an understanding of a problem? The programmer creates a design for the program, which starts by asking the customer what they need the program to accomplish. 2.What is pseudocode? Pseudocode is an informal language that has no syntax rules, and is not meant to be compiled or executed. 3.Computer programs typically perform what three steps? Step 1: Input is received. Step 2: Some process...

Words: 718 - Pages: 3

Premium Essay

Pt1420 Unit 2 Assignment 1

...Day 2 1.The instructor will advise the class on today's agenda and that at the end of class they will have created a summary paragraph of the previous class’s article. 2.The instructor will ensure comprehension and allow the students to demonstrate understanding of the previous day’s lesson . As students walk into the room, advise them to take a look at the Schema Board they had created prior class. Direct students to take out their graphic organizer. Engage the students in a class discussion. The topics of the discussion will be vocabulary terms, main ideas. Additionally, the teacher will discuss the confusion points from the exit ticket excercise from the prior day. Have students work through responses by guiding their responses...

Words: 535 - Pages: 3

Premium Essay

Pt1420 Unit 2 Research Paper

...The following question appeared in paper 2 of the June 2015 additional examination (actual question number 4.3): Drug-testing kits are sometimes used in schools. The current drug test which uses blood or urine samples is considered to be too personal (invasive). A new drug test, the Saliva Drug Test (SDT), uses saliva and is considered to be less personal than the current test. It can be used to test for up to 9 different types of drugs. The pictures below show the drug-testing instrument and the swab used to take a sample of saliva. The tree diagram below shows the outcomes of the SDT after testing the saliva of the same person twice. Study the tree diagram above to answer the following questions. 1. Give the probability (as a common fraction) of obtaining both...

Words: 624 - Pages: 3

Premium Essay

Pt1420 Unit 2 Assignment Analysis

...For the unit 2 assignment, you will develop a program that will simulate the rolling of a pair of dice. Your program must simulate rolling two dice and keep track of how many rolls are required before snake eyes are rolled (Note: “Snake Eyes” means that both dice show a value of 1). You will need to use a loop structure to repeatedly ‘roll the dice’. You will also need to make use of the if statement to determine if both die show a 1. You can use the example of an if statement below in your program and you can also read ahead to next week's lesson for more information on the if statement. To roll the dice, you can use the following Java statement which generates a random number between 1 and 6 (to represent the six sides of the dice). die1 =...

Words: 486 - Pages: 2

Premium Essay

Unit 2 Assignment 1 Pt1420

...Unit 2 Assignment 1: Homework Kenneth D. Davis Intro to Programming Short Answer 1. What does a professional programmer usually do first to gain an understanding of a problem? Interview the customer 2. What is pseudocode? Fake Code 3. Computer programs typically perform what three steps? 1. Input is received. 2. Some process is performed on the input. 3. Output is produced. 4. What does the term “user- friendly” mean? The term user- friendly is commonly used in the software business to describe pro-grams that are easy to use. Programs that do not display adequate or correct instruc-tions are frustrating to use, and are not considered user- friendly. One of the simplest things that you can do to increase a program’s user- friendliness is to make sure that it displays clear, understandable prompts prior to each statement that reads keyboard input. 5. What two things must you normally specify in a variable declaration? You must specify the variable type and an identifier 6. What value is stored in uninitialized variables? Some languages assign a default value as 0 to uninitialized variables. In many languages, however, uninitialized variables hold unpredictable values. Algorithm Workbench 1. Design an algorithm that prompts the user to enter his or her height and stores the user’s input in a variable named height. Set height = 72” Display ‘Enter your Height at Age 21’ Input hEIGHT Display ‘Enter your Height at Age 22’ Input hEIGHT ...

Words: 458 - Pages: 2

Premium Essay

Pt1420 Unit 2 Term Paper

...be delayed under the following three circumstances. Firstly, if the court finds reasonable cause to believe that providing immediate notification of the execution of the warrant may have an adverse result (definition in section 2705). If the warrant prohibits the seizure of any tangible property, any wire or electronic communication (definition in section 2510). Thirdly, if the warrant provides for the giving of such notice within a reasonable period of its execution, which period may thereafter be extended by the court for a good cause shown? However, the second circumstance has an exception as expressed in chapter 121 that any stored wire or electronic information, except where the court finds the reasonable necessity for the seizure. 2. The Patriot Act outlines the procedure for congressional oversight of intelligence activities. What makes congressional oversight necessary? Why should Congress be the branch of government that has such oversight? Congressional oversight is the responsibility of congress to monitor and supervise federal policies. Congressional oversight of intelligence activities is necessary because they deal with the critical issues of national security (Polelle, 2013). Congress is the branch of the government that is assigned with this function because of numerous reasons. They include; Congress is the body that has the power to make laws. All the matters concerning the government are dealt with laws. Because congress is the body that makes laws, it...

Words: 961 - Pages: 4

Premium Essay

Pt1420 Unit 5 Assignment 2

... The goal of my personal project was to, “Create a modification for the game Minecraft for its version labeled 1.8.9 written in Java, with efficient and organized code.” This goal involved me needing to research how to make Java code even neater, and how to make certain functions the code has even more efficient. I would also need to know differences between writing code for Minecraft’s 1.8.9 version, considering my prior knowledge consisted of writing code for Minecraft’s 1.7.10 version. I’ve familiarized myself with the Java coding language over the course of a year, and have decided to use this knowledge to create a product that anyone can use to enrich their experience while playing Minecraft. However, I’m not an expert in Java, therefore I do have a lot to learn about the language. In the past years, I’ve relied on modifications for Minecraft developed by other people to make my game experience even more entertaining for myself. I can see that there is a large portion of the community of people who play Minecraft, who play the game with modifications. In my opinion, in order to avoid losing interest in a game I use to entertain myself, I continue to add on to it by downloading a new modification and installing it. My inspiration for creating my own modification would be so that I can be in charge of delivering content to a game I enjoy, and be able to share my creation with the rest of the world. The Global Context of my Personal Project was Scientific and Technological...

Words: 1106 - Pages: 5

Premium Essay

Pt1420 Unit 2 Agression Analysis

...This means that the probability of missingness is not related neither to the recorded variables of the data nor the unobserved variable $Z$ itself. In other words, the behavior of $M_{Z}$ is statistically independent of all remaining variables of the data. For example, if the participants throw a coin to decide if they will answer a question or not, the missing item is MCAR. The independence of $M_{Z}$ from the missing values $Z$ cannot be tested because we do not have access to the values which people refused to give answers. The second type of Missing data is the mechanism Missing at Random (MAR). We assume that the sets $X$ and $Z$ and the indicator function $M_{Z}$ are the same as before. The MAR can be defined as $$\mathbb{P}(M_{Z}=1|X,Z)=\mathbb{P}(M_{Z}=1|X).$$ To be more specific, the data are MAR if the missing values are related to the variables $X$ which have been recorded but it is independent from the variable which is missing from the data. MAR assumption is difficult to be tested. For example, if we conduct a survey for the people's weight and we have missing values in the variable "weight", we may assume that the missingness comes from the overweight people who are ashamed to report their weight. However, we cannot be sure if this assumption is true or not. The MAR assumption will be correct if the people answer to questions like, "what is your height","how often do you work out". Such variables are highly correlated to the unknown variable and...

Words: 785 - Pages: 4

Premium Essay

Pt1420 Unit 2 Assignment 1: Homework

...programmer usually does first in programming is design flowcharts and pseudocode which will help with process. 2.) Pseudocode code is a fake code used as a model for programs; it has no syntax rules and is well written making it easy to translate to actual codes. 3.) Computer programs typically perform a three step process 1 input is received, 2 some process is performed on the input, 3 output is produced. 4.) “User-friendly” is commonly used in the software business to describe programs that are easy to use. Algorithm Workbench: 1.) 1 Display “Height” 2 Input height 3 Display “here is the height that you entered:”, height 2.) 1 Display “Favorite color” 2 Input favorite color 3 Display “Here is your favorite color you entered:”, color Programming Exercises: 1.) Personal Information 1 Display “Name” 2 Input Name 3 Display “Here is the name you have entered:”, name 4 Display “Address with city, state, and ZIP” 5 Input address with city, state, and ZIP 6 Display “This is the address you have entered:”, address with city, state, and ZIP 7 Display “Telephone number” 8 Input telephone number 9 Display “This is the telephone number you have entered:”, telephone 10 Display “College Major” 11 Input college major 12 Display “This is the college major you have entered:”, college major 4.) Total Price 1 Display “enter the items original price” 2 Input originalPrice 3 Set SalePrice = OriginalPrice * 0.06 4 Display “the sale price is $”,...

Words: 251 - Pages: 2

Premium Essay

Pt1420 Unit 2 Agression Analysis Database

...The total score for this section was 22. Using a cutoff of 14, which was the mean of the distribution, we categorized these scores into positive perceptions (14>) and negative perceptions (14≤). The overall scores for these two sections was an indicator of the knowledge levels as well as the associated perceptual attitudes. In the same way, a total score of the systematic and patient-related barriers to breast cancer screening was calculated. Using the same scale (0-2), the total of all items was 22 for the system-related barriers section and 34 for the patient-related barriers section. System-related barriers were classified into low score barrier (>9) and high score barrier (9≤), where 9 represents the mean for the calculated total system-related score. Personal barriers were classified into low score barrier ( ), intermediate score barrier ( ), and high score barrier ( ≤). Cronbach's Alpha for the reliability was 0.867, reflecting an excellent internal consistency of the designed questionnaire. The categorized groups were cross-tabulated using frequency tables and pie charts or bar charts with the socio-economic...

Words: 516 - Pages: 3