Unit 2 Lab

1031 Words5 Pages
Solutions Lab 3: Input, Processing, and Output Lab 3.1 –Flowcharts Note to Instructor: Steps 1 – 9 walk students through the process of using Raptor and designing a flowchart. Step 10 requires students to show their completed flowchart. Variable names and statements will vary from student to student. Also, the lab can be completed using a different flowcharting application, such as Visio. If so, the sample solution below will look a little different, but should still have the same fundamental steps. Instructors should grade on clear variable names, proper flow of program, the correct calculation, and the right output. Below is a sample solution to the programming problem. Step 10: Lab 3.2: Python Code Note to Instructor: Steps 1 - 5 require students to think critically about input and output and answer questions. Steps 6 - 18 in this lab require the student to write Python code to create a program. Their final program is required in Step 19. Variable names and statements will vary from student to student. Instructors should grade the final program on clear variable names, proper flow of program, the correct calculation, and the right output. Step 1: Examine the following line of code. What do you expect as output to the screen? studentName = raw_input(‘Enter student name. ‘) Enter student name. Step 2: Examine the following line of code. What type of value do you expect the user of the program to enter? creditsDegree = input(‘Enter credits required for degree.’ A number such as 63. Step 3: Select with an X which function should be used to take in input from the user. The functions raw_input or input are determined based on the data type of the variable. raw_input( ) input( ) studentName ¬¬¬¬¬¬¬¬¬¬¬¬_____X______ ____________

More about Unit 2 Lab

Open Document