Search for question
Question

Be sure to keep a backup copy of any files you submit to the school! Introduction You'll apply the concepts of Lesson 3 to create a basic menu-driven program. Instructions You'll

create both pseudocode and a flowchart to design an application that displays the following menu: Select a Planet 1. Mercury 2. Venus 3. Earth 4. Mars 5. Exit the program Enter your selection. When the user selects a planet from the menu, the program should Copyright Penn Foster, Inc. 2019 Course Version: 1 Page 23/n F4 3.5 Create a basic menu-driven program CSC105 Graded Project 3 READING ASSIGNMENT Your project must be submitted as a zipped/compressed (*.zip) file that includes the following files: Text file (.txt) of your pseudocode • Screenshot(s) in JPEG format (*.jpg) of your flowchart A Rich Text Format (*.rtf) or Microsoft Word (*.doc) file that lists the following information: o Your name o Your student ID number o The exam number o Your email address Copyright Penn Foster, Inc. 2019 Course Version: 1 % For information on how to take and save a screenshot on your computer or to zip files, review the instructions for CSC105 Graded Project 1. Save your compressed file as [Your Name]_CSC105_Graded Project3. Your project will F5 Search F6 8 F7 F8 PRE F9 prt sc F10 home Page 22 F11 end F12 G tut & Stu pennfoster.com/pdf/418038.pdf Read aloud F3 ㅊ F4 Acc Pro 418 x 418 Vic Vio Gho Ask Copilot Be sure to keep a backup copy of any files you submit to the school! Introduction Instructions You'll apply the concepts of Lesson 3 to create a basic menu-driven program. Select a Planet 1. Mercury 2. Venus 3. Earth You'll create both pseudocode and a flowchart to design an application that displays the following menu: 4. Mars 5. Exit the program Enter your selection. Copyright Penn Foster, Inc. 2019 Course Version: 1 When the user selects a planet from the menu, the program should F5 24 of 38 Search F6 (13 Bes WW3 F7 F8 F9 prt sc F10 home F11 Page 23 Pol WC+0 end F12 insert A Stu Acc ster.com/pdf/418038.pdf Read aloud Ask Copilot F3 Pro 418 x 418 Vic Vic Gho F4 Mercury Venus display the following information about the planet: Earth Mars F5 Average distance from the sun Mass Surface temperature Average distance from the sun Mass Surface temperature Average distance from the sun Mass A Surface temperature Average distance from the sun Mass 0: Surface temperature Q Search F6 & F8 25 * of 38 (13 57.9 million kilometers 3.31 x 10^23kg Bes W W3 Pol WC+ LS5 CS b c+ -173 to 430 degrees Celsius 108.2 million kilometers 4.87 x 10^24kg 472 degrees Celsius 149.6 million kilometers 5.967 x 10^24kg F9 -50 to 50 degrees Celsius 227.9 million kilometers 0.6424 x 10^24kg -140 to 20 degrees Celsius prt sc F10 home F11 end F12 insert delete tute A Stu foster.com/pdf/418038.pdf Read aloud F4 Acc Pro 418 X Ask Copilot Copyright Penn Foster, Inc. 2019 Course Version: 1 418 Vic Vio Gho Grading Criteria Your instructor will use the following guidelines to grade your project. The pseudocode is accurate and in the correct format. TOTAL The menu-driven program is designed to effectively show a menu from which the user can make a selection and see the correct display of the corresponding data. F5 The flowchart is accurate and uses the appropriate shapes. Q Search F6 26 of 38 F7 8 F8 (13 Bes W W3 Pol WC+ LSS cs/ b c+/ F9 11:0 prt sc F10 C home F11 Page 24 34 points 33 points 33 points 100 points L end F12 insert delete Do/n Arrays, Files, and Menu-Driven Programs PENN FOSTER Introduction to Programming : Arrays, Files, and Menu-Driven Programs Lesson 3 Overview In this lesson, you'll learn about arrays and menu- driven programs. First, you'll learn about arrays and the various types of arrays you can create. You'll learn how to use 3 algorithms to sort and search arrays. Then, you'll learn about file input and output and how to process files. And finally, you'll learn about menu-driven programs and how you can use them in your programs. 3.1 Describe the use of arrays in programming languages Arrays READING ASSIGNMENT Read this assignment. Then, read Chapter 8 of your textbook. Arrays are lists of variables in the computer's memory that have the Copyright Penn Foster, Inc. 2019 Course Version: 1 Page 1 same name. They're distinguished from each other by subscripts or numbers that indicate the variable's position in the array. An example of an array is a set of file folders in a file cabinet that's alphabetized from A through Z. Storage locations within an array are known as elements. Each element in an array is assigned a unique number known as a subscript or index. Using the subscripts is how you can access the individual elements in an array. You can input and output array contents of an array element just as you would a regular variable. It's also possible to use a loop to step through an entire array and perform the same operation on each variable. Your textbook explains how to do so as well as how to do the following: • Process elements of an array • Initialize an array with values when you declare it • Perform array bounds checking, which means the programming language won't allow a program to use an invalid array subscript • Watch for off-by-one errors, which result when a loop iterates one time too many or one time too few • Create partially filled arrays, which may be useful if you need to store a series of items in an array but you don't know the exact number of items in the series You'll also learn how to search for data stored in an array. When Copyright Penn Foster, Inc. 2019 Course Version: 1 Page 2 searching for an array to find a value, you must do the following: 1. Create a variable. 2. Use a loop to test each array element. 3. Set a flag for when a match is found. There are many operations you can perform on an array using a loop: Totaling or averaging the values in an array Finding the highest or lowest value in an array Passing an array as an argument to a module or function Some special types of arrays include the following: • Parallel arrays involve two arrays in which each element in the first array is associated with the element in the same position in the second array. • Two-dimensional arrays store multiple data sets in several identical arrays. • Multidimensional arrays model data in multiple sets. ● Make sure to answer the checkpoints in the textbook as you read the chapter. Check your answers in Appendix E at the back of your textbook. Key Points and Links READING ASSIGNMENT Key Points Copyright Penn Foster, Inc. 2019 Course Version: 1 Page 3 • Arrays are lists of variables in the computer's memory that have the same name. • Storage locations within an array are known as elements, and each element is assigned a unique number known as a subscript or index. • You can input and output array contents of an array element just as you would a regular variable, or use a loop to step through an entire array and perform the same operation on each variable. • When searching for an array to find a value, you must create a variable, use a loop to test each array element, and set a flag for when a match is found. • Some special types of arrays include parallel arrays, two- dimensional arrays, and multidimensional arrays. Exercise: Arrays Answer the Review Questions and the following exercises at the end of Chapter 8 in your textbook: • Algorithm Workbench 1, 3, and 8 Debugging Exercises 1 and 2 Programming Exercise 3 ● Exercise Answer Key: Exercise: Arrays Review Questions Copyright Penn Foster, Inc. 2019 Course Version: 1 Page 4

Fig: 1