Logic Problems:

 

These problems will be part of the in class lecture – distance learning students should attempt the solution as well.

 

Problem #1:

 

I want to know the average number of courses taken by students in the class.  I also want to know the total number of courses taken by students in the class.

 

Screen entry input:  Each student enters the number of courses they are taking.

 

Processing:  Accumulate the totals.  When the instructor enters 99 for the number of courses, the processing will terminate.

 

Output:  Average number of courses, total number of courses

 

Problem #2:

 

Take user information from the screen about user id, user name, pay type, pay per hour and hours worked.  Print out pay.  At the end of processing print out the total pay earned and the total number of employees that you processed.

 

Input:  user id, user name, pay type, pay per hour, hours worked

 

Processing: Calculate pay in the following way.  If the type is F for fulltime they are to receive overtime for hours over 40.  Overtime means time and one half.  For P for part-time there is no overtime for hours over 40

 

Output:  User id, user name, pay.  At the end of the report, the sum of the pay and the number of employees should be displayed..

 

 

Problem #3:

 

Print out the addition math facts from 1 to 12.

 

Input:  None

 

Processing:  Calculate  the answer for each problem in sequence.  1 + 1 = 2 through 12 + 12 = 24

 

Output:  Show the math facts

 

Problem #4:  The game rock, paper, scissors.  Rules:  Rock breaks scissors, Paper covers rock, Scissors cut paper.

 

Input:  The user chooses rock, paper, or scissors or quit to end

 

Processing:  The computer randomly chooses a number in the range 1 – 3.  A one stands for rock, a two stands for paper and a 3 stands for scissors. The program must determine who won

 

Output:  Statement of the winner and option to play again.  User can choose quit to end.