Python language program 1. You just got a job working for the local Honda motorcycle shop. For every motorcycle you sell you get 10% commission. Using a while loop create the following output. Enter the sale amount: 9999 Your commission is $999.90. Your paycheck will be $999.90. Did you make another sale: Y Enter the sale amount: 4599 Your commission is $459.90 Your paycheck will be $1,459.80 Did you make another sale: N
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Python language program
1. You just got a job working for the local Honda motorcycle shop. For every motorcycle you sell you get 10% commission. Using a while loop create the following output.
Enter the sale amount: 9999
Your commission is $999.90.
Your paycheck will be $999.90.
Did you make another sale: Y
Enter the sale amount: 4599
Your commission is $459.90
Your paycheck will be $1,459.80
Did you make another sale: N
2. Write an application that uses a while loop to validate 3 test scores.
What is the first test score: 101
Please re-enter a number between 0 and 100
What is the first test score: 100
What is the second test score: 110
Please re-enter a number between 0 and 100
What is the second test score: 99
What is the third test score: 87
With an average score of 95.33% you are on track for an A in this course.
Step by step
Solved in 2 steps with 2 images