Thread: program logic class

Results 1 to 5 of 5
  1. #1 program logic class 
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    nothing too difficult. if someones familiar with pseudo coding, just wondering if i did this assignment correctly.

    these are the problems:

    Code:
    // This pseudocode segment is intended to describe
    // computing then displaying your average score of 
    // two classroom tests.
    
    start
       input midtermGrade
       input finalGrade
       midtermGrade + final = totalPoints
       average = final / 3
       output totalPoints
    stop
    Code:
    Develop the logic of a program that allows the user to enter two
    values.  The program should then compute and display the sum
    of the two values.  The program should then compute and display
    the difference of the two values.
    
    Pseudocode:
    Code:
    Develop the logic of a program that allows the user to enter: 
    	(1) his or her hourly pay rate
    	(2) the number of hours he or she worked
    	(3) the percentage of gross salary to be withheld
    
    The program should multiply the hourly pay rate by the number of 
    hours worked, giving the gross pay.  Then, it should multiply the 
    gross pay by the withholding percentage, giving the withholding 
    amount. Finally, it should subtract the withholding amount from the 
    gross pay, giving the net pay. 
    
    The program should then display the net pay.
    
    Pseudocode:
    this is what i did.

    Code:
    // This pseudocode segment is intended to describe
    // computing then displaying your average score of 
    // two classroom tests.
    
    start
       input midtermGrade
       input finalGrade
       set totalPoints = midtermGrade + final
       set average = totalPoints / 2
       output average
    stop
    
    --------------------------------------------------------------
    start
    	input numberOne
    	input numberTwo
    	set sum = numberOne + numberTwo
    	output sum
    	set difference = numberOne - numberTwo
    	output difference
    end
    ---------------------------------------------------------------
    start
    	input rate
    	input hour
    	input grossPercentage
    	set grossPay = rate * hour
    	set heldAmount = grossPay * grossPercentage
    	set netPay = grossPay - heldAmount
    	output netPay
    end
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2012
    Posts
    286
    Thanks given
    7
    Thanks received
    49
    Rep Power
    25
    I thought difference means to subtract a number from another number but I'm not a native English speaker so I might be wrong. Otherwise looks good
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    Quote Originally Posted by juuuuu View Post
    I thought difference means to subtract a number from another number but I'm not a native English speaker so I might be wrong. Otherwise looks good
    i think you might be right lol.
    Reply With Quote  
     

  4. #4  
    Iceking's Bitch
    N P C's Avatar
    Join Date
    May 2013
    Posts
    215
    Thanks given
    14
    Thanks received
    22
    Rep Power
    43
    Looks good
    Currently studying: N/A
    Occupation: Software Engineer
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Mar 2013
    Posts
    158
    Thanks given
    38
    Thanks received
    37
    Rep Power
    0
    Quote Originally Posted by Our Promise View Post
    i think you might be right lol.
    A difference is the result of a subtraction problem.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 7
    Last Post: 03-24-2012, 03:26 PM
  2. Replies: 4
    Last Post: 02-26-2012, 12:54 AM
  3. Replies: 0
    Last Post: 10-20-2011, 04:44 AM
  4. Replies: 8
    Last Post: 08-15-2011, 06:12 AM
  5. Replies: 14
    Last Post: 07-05-2011, 01:33 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •