Pseudocode

In: Computers and Technology

Submitted By oliver19
Words 919
Pages 4
Question:
Analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as at least one function call and the use of at least one array. The specific problem you need to solve for the final project is: Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas.
2. What is the required output? What is the necessary input? How you will obtain the required output from the given input? Clearly describe variable names and definitions. Include all necessary formulas and example calculations.
3. Display pseudocode of your overall design including the Main module and the order of the module, subprogram and function calls.
4. Create a Hierarchy chart for the overall program in raptor
5. detailed pseudocode for each module, subprogram and function.
6. Add pseudocode comments with all major functionality and most minor functionality commented
7. Show test plan covering all major functionality and most minor functionality. Multiple Input and expected output provided for most modules.
SOLUTION:
Analysis: For this program, user will be asked for name, age and state of their family members, one by one, until the user decides to stop entering this information. To achieve the given task (printing average family age and identifying residents of Texas), following modules need to be created: * Main module: This module will be the one running on program startup. It will be responsible to get user input and call appropriate modules to calculate and display average family age and display family members those are residents of Texas * calcAverageAge module: This module will take family ages as input and…...

Similar Documents

Square Footage

...Pseudocode: An Introduction Flowcharts were the first design tool to be widely used, but unfortunately they do not very well reflect some of the concepts of structured programming. Pseudocode, on the other hand, is a newer tool and has features that make it more reflective of the structured concepts. Unfortunately, the narrative presentation is not as easy to understand and follow. RULES FOR PSEUDOCODE 1. Write only one stmt per line Each stmt in your pseudocode should express just one action for the computer. If the task list is properly drawn, then in most cases each task will correspond to one line of pseudocode. EX: TASK LIST: Read name, hourly rate, hours worked, deduction rate Perform calculations gross = hourlyRate * hoursWorked deduction = grossPay * deductionRate net pay = grossPay – deduction Write name, gross, deduction, net pay PSEUDOCODE: READ name, hourlyRate, hoursWorked, deductionRate grossPay = hourlyRate * hoursWorked deduction = grossPay * deductionRate netPay = grossPay – deduction WRITE name, grossPay, deduction, netPay 2. Capitalize initial keyword In the example above, READ and WRITE are in caps. There are just a few keywords we will use: READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE, REPEAT, UNTIL 3. Indent to show hierarchy We will use a particular indentation pattern in each of the design structures: SEQUENCE: keep statements that are “stacked” in sequence all starting in the same column. SELECTION: indent the statements that fall......

Words: 1559 - Pages: 7

Pseudocode - Texas Assignment

...Problem Statement - Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas. Family contains a maximum of ten members. Pseudocode: //Main Method MAIN //variable declarations //create parallel array to store family members information //array of Strings for family names DECLARE names[10] of STRING //array of ages for family members DECLARE ages[10] of INTEGER //array of states where they reside DECLARE states[10] of STRING //stores the total number of family members //as entered by user DECLARE count as INTEGER //age average DECLARE average as FLOAT DECLARE count as INTEGER SET count = 10 //declare variables to store current user input DECLARE name as STRING DECLARE age as INTEGER DECLARE state as STRING //prompt for family member count WRITE "How many family members do you have? " //read the value from user INPUT count //use for loop to prompt user to enter information //for all family members //repeat the loop "count" times FOR (COUNTER=1; counter <= count; COUNTER++) //prompt for name WRITE "Enter family member name: " INPUT name //prompt for age WRITE "Enter family member age: " INPUT age //prompt for state WRITE "Enter family member state: " INPUT state //store input values in the array SET names[COUNTER] = name SET......

Words: 456 - Pages: 2

Pseudocode

...exercises you will find below. The quiz will ask you to write pseudocode for a particular problem. • We have provided previous semesters’ quizzes at the end. Take a look at them so you get an idea of the pseudocode we expect. The following exercises cover the material to be covered in Quiz #2. Solutions to these exercises will not be provided, but you are welcome to discuss your solutions with the TA and the instructor during office hours. Keep in mind that in the following exercises you are being asked to provide only pseudocode. 1. Write pseudocode for a program that computes the average of a set of values after the highest and lowest scores have been removed. 2. Write pseudocode for a program that reads a sequence of integer values and determines whether it is a decreasing sequence. A decreasing sequence is one where each value is greater than or equal to the next element in the sequence. The program will first read the number of values to process followed by the values in the sequence. The program will print the message "Decreasing" for a decreasing sequence and "Non-Decreasing" otherwise. For example, here are two decreasing sequences: 90 87 30 0 -1 -2 110 4 0 -20 The following are non-decreasing sequences: 90 100 20 4 30 24 -2 -1 8 9 3. Write pseudocode for a program that display a multiplication table for a......

Words: 841 - Pages: 4

Intro to Programming

...Individual Project Professor IT106-1401A-05: Introduction to Programming Logic Contents Phase 1 3 Deposit 3 Transfer 3 Phase 2 4 Problem Analysis Chart 4 Inquiry 4 Deposit 4 Transfer 4 Structure Chart 4 IPO 4 Inquiry 4 Deposit 4 Transfer 4 Coupling Diagram 4 Data Dictionary 4 Phase 3 5 Inquiry 5 Flowchart 5 Pseudocode 5 Deposit 5 Flowchart 5 Pseudocode 5 Transfer 5 Flowchart 5 Pseudocode 5 Phase 4 6 Flowchart 6 Pseudocode 6 Phase 5 7 Inquiry 7 Deposit 7 Transfer 7 Phase 1 Part 2: Determine current amount available in checking account (balanceChecking)-$50.00 Determine what the transfer amount will be (transferAmount)-$25.00 Retrieve the transaction number for confirmation (transactionNumber)-54643635345 Phase 2 Problem Analysis Chart Given Data | Required Results | Account number and PIN | Account Balance | Processing Required | Solution Alternatives | 1. Access banking systems to retrieve data 2. Provide to customer | 1. Have an automated system that emails balance info as opposed to displaying it. | Structure Chart Account information | VerifyInfo | Provide info | AccessInfo | Locate Retrieve PIN Display Info IPO Input | Processing | Module Reference | Output | Account numberWhich......

Words: 315 - Pages: 2

Multimedia

...1 Activity—Output and Pseudocode TCO 5 | Given a simple business problem, design and desk-check a solution algorithm that is expressed in terms of pseudocode or program notes and input-process-output (IPO) analysis leading to a flow chart. | Assignment: This activity will assist you in the understanding the input, process, and output (IPO) model using a provided set of data to write psuedocode ahead of processing the data and showing the results. 1. Rewrite the supplied data set in pseudocode format using proper verbs for describing input, process, or output needs along with assignment statements for calculations. 2. Perform calculations based on the pseudocode and assignment statements. 3. Show the result of each pseudocode program in the output display. Rubric: When completed, please submit the following items. 1. The instruction sheet. 2. Your answer sheet. Point distribution for this activity: Pseudocode Activity | Document | Points possible | Points received | Problem #1 | 6 | | Problem #2 | 6 | | Problem #3 | 8 | | Total Points | 20 | | Problem #Example: The variable A starts with the value 2. The variable B starts with the value 4. The variable C starts with the value 6. Store the value of A added to B in A. Store the value of B added to C in C. Multiply A times C, and store the result in B. Display the value in B on the screen. Pseudocode......

Words: 696 - Pages: 3

Pseudocode

...In event that was rather a stir up in the 1920’s was the Harlem Renaissance. The Harlem Renaissance was a time when African Americans all around showcased their artistic talents, showing the whites that they did indeed have talent. Obviously after the name “The Harlem Renaissance” was based in Harlem, New York. The Harlem Renaissance was a movement of writers, artist, actors, musicians, and poets of color expressing themselves through their talents. They used these talents not only to express themselves but also to tell stories of their past and the troubles the black people faced as a whole. This movement brought together so many African Americans. Not only that but it showed the white people of America they weren’t the only people who had talents. The arts were shared, whites bought black paintings and they were entertained by black shows that went on in venues. Often there were poems that were exclusively written for black people of America. During the renaissance Things were happening and the people of the Harlem Renaissance were reacting. Langston Hughes was a writer who created quite the impact during the Harlem Renaissance. He wrote poems, stories and even plays. He kept black communities entertained and gave opportunity with his plays. His poems kept African Americans motivated and pushing for what was right, equality. Jacob Lawrence was an artist creating abstract pictures of events happening beginning in 1917. He was the artist of “ The Great Migration Series”......

Words: 355 - Pages: 2

Pseudocode

...room is rectangular. There are 4 components of your submission including: Program Description- A detailed, clear description of the program you are building. Analysis- Demonstrates your thought process and steps used to analyze the problem. Be sure to include the required input and output and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe the necessary formulas and sample calculations that might be needed. Test plan - Prepare at least 3 sets of input data (Test data) along with their expected output for testing your program. Your test data can be presented in the form of a table as follows (note: feel free to adapt to your design) Pseudocode- Provide pseudocode of your overall design that fulfills the requirements of the project All of these components can be placed in word document. Example application test data: Test Case # Input Expected Output 1 Room1: length=10, width=14; Room 2: length=9, width=10; Room 3: length=12, width=12; 374 square feet 2 Your room dimensions Your output 3 Your room dimensions Your output Submission requirements: Your completed assignment should be saved as Word document and submitted to your assignment area no later than the due date listed in the syllabus. Your document should be neat, well-written with minimal grammatical and spelling errors. Your name should be clearly listed on the first page......

Words: 326 - Pages: 2

Pseudocode

...Main module: Declare Jobs As String Declare Date As String Declare Spring As String Declare Fall As String Declare Winter As String Declare Storm As String Declare Monthly As String Declare Season As INT Write “Choose what tasks you need to check!” Write “Spring………..1” Write “Fall…………..2” Write “Winter……….3” Write “Storm………..4” Write “Monthly……..5” Input = Season If (Season < 0 or Season > 6) Then Write “You need to input a number between 1 – 5.” If input = 1 Then call Spring module Else If input = 2 Then call Fall module Else If input = 3 Then call Winter module Else If input = 4 Then call Storm module Else If input = 5 Then call Monthly module End If Spring module: Write “You have selected to view the Sping checklist of your home maintenance.” Write “These are the things you need to check for listed below:” Jobs Write “What jobs did you complete?” Input Job Write “Congratulations! You have completed checking the “ + Jobs + Date + “ Make sure you check that job again next spring.” Fall module: Write “You have selected to view the Fall checklist of your home maintenance.” Write “These are the things you need to check for listed below:” Jobs Write “What jobs did you complete?” Input Job Write “Congratulations! You have completed checking the “ + Jobs + Date + “ Make sure you......

Words: 411 - Pages: 2

Help Me Now

...input, processing, and output stages. Create the necessary flowcharts to describe a program’s structure. Use pseudocode to define a program’s structure. Formulate solution algorithms for calculations by properly following the order of operations. Assignment Requirements Answer: * Short Answer 1, 2, 3, and 4 on page 71 * Algorithm Workbench Review Questions 1 and 2 on page 71 * Programming Exercises Questions 1 and 4, starting on page 72 Required Resources Textbook Submission Requirements Submit your written answers to your instructor at the beginning of Unit 3. Unit 3 Assignment 1: Homework Learning Objectives and Outcomes Describe the use of variables (declaration, naming, assignment, and initialization) in program designs. Use the correct data type for variables in program designs. Describe the usefulness of properly commenting code. Assignment Requirements Answer: * Short Answer 5 and 6 on page 71 * Algorithm Workbench Review Questions 3-10, starting on page 71 * Programming Exercise Questions 6 and 8 on page 73 Required Resources Textbook Submission Requirements Submit your written answers to your instructor at the beginning of Unit 4. Unit 4 Assignment 1: Homework Learning Objectives and Outcomes * Explain the importance of separating code into modules for efficiency. * Use flowcharts and pseudocode to represent program modules. * Describe the impact of program modules on variables—variable......

Words: 6097 - Pages: 25

Pseudocode - Using Functions to Solve Dimensions of Rectangle

...PseudoCode : //This program will calculate the area and perimeter using different functions. //The numerical values for length and width will be provided as an input by the user //Set function areaofrec as float //Set function periofrec as float //START Program //set menuSelect, intValue as int //set length, width, and result as float //set while loop (while intValue >0) continue loop //print “Enter a positive integer to calculate the area or perimeter of a rectangle; “ //print “OR a negative integer to exit program” //input positive or negative integer //create if else statement //If intValue >0 continue with program //else if intValue < 0 exit program //if intValue > 0 print “Enter 1 to calculate area, 2 to calculate perimeter” //input menuSelect option //if menuSelect == 1 //call the area function //print “you chose to calculate the area of the rectangle!” //print “please enter the length and width of the rectangle” //print “enter length first, hit enter, enter width, hit enter” //input length and width //set result = areaofrec(length,width) //print result “The area of the rectangle is (result) “ //else if menuSelect == 2 //call the perimeter function //print “you chose to calculate the perimeter of the rectangle!” //print “please enter the length and width of the rectangle” //print “enter length first, hit enter, enter width, hit enter” //input length and width //set result = periofrec(length,width) //print result “The......

Words: 280 - Pages: 2

Dbms

...ROBOTC Reference Pseudocode & Flow Charts Pseudocode is a shorthand notation for programming which uses a combination of informal programming structures and verbal descriptions of code. Emphasis is placed on expressing the behavior or outcome of each portion of code rather than on strictly correct syntax (it does still need to be reasonable, though). In general, pseudocode is used to outline a program before translating it into proper syntax. This helps in the initial planning of a program, by creating the logical framework and sequence of the code. An additional benefit is that because pseudocode does not need to use a specific syntax, it can be translated into different programming languages and is therefore somewhat universal. It captures the logic and flow of a solution without the bulk of strict syntax rules. Below is some pseudocode written for a program which moves as long as a touch sensor is not pressed, but stops and turns to the right if its sonar detects an object less than 20in away. task main() { while ( touch sensor is not pressed ) { Robot runs forward if (sonar detects object < 20in away) { Robot stops } } } Robot turns right Some intact syntax The use of a while loop in the pseudocode is fitting because the way we read a while loop is very similar to the manner in which it is used in the program. Descriptions There are no actual motor commands in this section of the code, but the pseudocode suggests......

Words: 679 - Pages: 3

Week 1 Activity—Pseudocode and Visual Basic

...Week 1 Activity—Pseudocode and Visual Basic ------------------------------------------------- TCO 1—Given a simple business problem, design and desk-check a solution that is expressed in terms of pseudocode, flowchart, and/or input-process-output (IPO) diagrams. ------------------------------------------------- Assignment This activity will assist you in the understanding of how output should appear after statements are executed (results) and how to write proper pseudocode, as well as the relationship between pseudocode, flowcharts, and programming language code. 1. Show the result of each pseudocode program. 2. Also, rewrite the pseudocode statements or flowchart using assignment statements. Rubric When completed, compile the following documents together neatly in 1 and 2 order. 1) This instruction sheet first 2) Your answer sheet second Point distribution for this activity: Activity | Document | Points possible | Points received | Problem #1 | 6 | | Problem #2 | 6 | | Problem #3 | 8 | | Total Points | 20 | | Example The variable A starts with value 5. Add 1 to A Display the value of A on the screen. Example Output ------------------------------------------------- ------------------------------------------------- 6 ------------------------------------------------- Example Pseudocode ------------------------------------------------- ------------------------------------------------- Let A...

Words: 477 - Pages: 2

Cis 115 Slingshot Academy /Snaptutorial.Com

...statements are executed (results) and how to write proper pseudocode. 1. Show the result of each pseudocode program. 2. Also rewrite the pseudocode statements using Assignment statements. Rubric: When completed compile the following documents together neatly in 1 & 2 order: 1) This instruction sheet first 2) Your answer sheet, second Point distribution for this activity: Pseudocode Activity Document: Points possible: Points received Problem #1 6 Problem #2 6 Problem #3 8 Total Points 20 Problem #1: The variable X starts with the value 0. The variable Y starts with the value 5. Add 1 to X. Add 1 to Y. Add X and Y, and store the result in Y. Display the value in Y on the screen. Output #1: Pseudocode #1: Problem #2: The variable J starts with the value 10. The variable K starts with the value 2. The variable L starts with the value 4. Store the value of J times K in J. Store the value of K times L in L. Add J and L, and store the result in K. Display the value in K on the screen. Output #2: Pseudocode #2: Problem #3: The variable A starts with the value 1. The variable B starts with the value 10. The variable C starts with the value 100. The variable X starts with the value 0. Store the value of C times 3 in X. Add the value of B times 6 to the value already in X. Add the value of A times 5 to the value already in X. Display the value in X on the screen. Output #3: Pseudocode......

Words: 862 - Pages: 4

Chapter 2

...Set result = x+y 12 b. Set result = z*2 4 c. Set result = y/x 4 d. Set result = y-2 6 5. Write a pseudocode statement that declares the variable COST so it can hold real numbers. Declare real variable cost 6. Write a pseudocode statement that declares the variable TOTAL so it can hold integers. Initialize the variable with the value 0. Declare Real Price=0 7. Write a pseudocode statement that assigns the value 27 to the variable content. Count=27 8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable COUNT. Count=10+14 9. Write a pseudocode statement that subtracts the variable downPayment from the variable TOTAL and assigns the result to the variable DUE. DUE = downPayment – TOTAL 10. Write a pseudocode statement that multiplies the variable SUBTOTAL by 0.15 and assigns the result to the variable to TOTALEFEE. TOTALFEE = SUBTOTAL * 0.15 11. If the following pseudocode were an actual program, what would it display? Declare integer a = 5 Declare integer b = 2 Declare integer c = 3 Declare integer result Set result = a + b + c Display result 5+2*3 11 12. If the following pseudocode were an actual program, what would it display? Declare integer num = 99 Set num = 5 Display num 5 Debugging Exercises 1. If the following pseudocode were an actual program, why would it not display the output that the programmer expects? Declare string......

Words: 729 - Pages: 3

Cis 115 Slingshot Academy / Tutorialrank.Com

...expression, which of the following operators (or mathematical operations) has the lowest precedence? (Points : 4) 8. (TCO 2) Using the assignment statement, + sales, which side of the equal sign is evaluated first? (Points : 4) 9. (TCO 2) What value will be contained in the variable, x, after the following statement is executed? * 5 / 10 + 6 (Points : 4) 10. (TCO 2) Review the partial pseudocode below. What is the correct math expression to complete the algorithm and total sales for both regions? Prompt “Enter total sales for region 1: ” Input region1 Prompt “Enter total sales for region 2: ” Input region2 Set _____ Display “total sales: ” + total (Points : 4) 11. (TCO 3 & 4) Review the pseudocode below. What will be displayed when this algorithm executes? Set If ((x > 10) AND (x < 20))=""> Display “the IF path executes” Else Display “the ELSE path executes” EndIf (Points : 4) 12. (TCO 3 & 4) What value gets displayed for the variable X? Set Set Set If (B > 15) AND (() OR (C Set Else Set EndIf Display X (Points : 4) 13. (TCO 3 & 4) In the following pseudocode, what raise will an employee in Department 6 receive? If department < 2=""> Set Else If department < 6=""> Set Else Set EndIf EndIf (Points : 4) 14. (TCO 3 & 4) Which of the selection structures determines if the user enters a number between 20 and 45? (Points : 4) 15. (TCO 3 & 4) What value gets displayed for the variable Z? Set Set Set If ((balance 800) OR......

Words: 6846 - Pages: 28

Descargar | Ghost in the Shell | Gotham HDTV 720p AC3 5.1