Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
To make it Simple
“Which statements are to be executed and in which order is called an algorithm”
And
“Specifying the order in which statements are to be executed in a computer
program is called program control”.
Sequential Transfer of
Execution Control
First Refinement
Second
Refinement
float
(float ) total
%.2f
Write a program that calculates the sum of the integers from 1 to 10. Use the while
statement to loop through the calculation and increment statements. The loop
should terminate when the value of x becomes 11.
(Sales Commission Calculator) One large chemical company pays its salespeople
on a commission basis. The salespeople receive PKR.200 per week plus 9% of their
gross sales for that week. For example, a salesperson who sells PKR.5000 worth of
chemicals in a week receives PKR.200 plus 9% of PKR.5000, or a total of PKR.650.
Develop a program that will input each salesperson’s gross sales for last week and
will calculate and display that salesperson's earnings. Process one salesperson's
figures at a time. Here is a sample input/output dialog: