13
Programming Problems
Pseudocode for chapter 2 checkpoint
Frank T. Hartman
IT 210
13
Programming Problems
Pseudocode for chapter 2 checkpoint
Frank T. Hartman
Programming Problem 1
Main Module
Declare SalesAmount As Real
Declare CommissionRate As Real
Declare CommissionEarned As Real
Display “Welcome User.”
Display “Starting new commission calculations.”
Call User Input Module
Call Calculate Commission Module
Call Display Calculations Module
End Main Module
User Input Module
Display “Please enter monthly sales amount.”
Input SalesAmount
Display “Please enter commission rate.”
Input CommissionRate
End User Input Module
Calculate Commission Module
CommissionEarned = SalesAmount*(CommissionRate/100)
End Calculate Commission Module
Display Commission Module
Display “Your earned commission is” CommissionEarned”.”
End Display Commission Module
Programming Problem 2
Main Module
Declare ItemName As Real
Declare ItemPrice As Real
Declare ItemWeight As real
Declare UnitWeight As Real
Declare UnitPrice As Real
Declare TotalPrice As Real
Display “Welcome to Super Supermarket’s Cost Calculator.”
Display “Starting new cost calculations”
Call User Input Module
Call Unit Weight Module
Call Unit Price Module
Call Cost Display Module
End Main Module
User Input Module
Display “Please enter item name.”
Input ItemName
Display “Please enter item price.”
Input ItemPrice
Display “Please enter item weight.”
Input ItemWeight
End User Input Module
Unit Weight Module
UnitWeight=ItemWeight*16
End Unit Weight Module
Unit Price Module
UnitPrice=ItemPrice/UnitWeight
End Unit Price Module
Total Price Module
TotalPrice=UnitWeight*UnitPrice
End Total Price Module
Cost Display Module
Display “The cost of”ItemName:”per ounce cost:”UnitPrice”.”
Display “Total price of”ItemName”cost”TotalPrice”.”
End Cost Display Module
Programming Problem 3
Main Module
Declare EmployeeID As Real
Declare HourlyRate As Real
Declare RegHours As Real
Declare OvertimeHours As Real
Declare GrossPay As Real
Declare Tax As Real
Declare NetPay As Real
Display “Welcome to Wage Calculator”
Display “Please enter all information carefully”
Call User Input Module
Call Gross Pay Module
Call Tax Module
Call Net Pay Module
Call Display Module
End Main Module
User Input Module
Display “Please enter Employee ID number”
Input EmployeeID
Display “Please enter hourly rate of pay”
Input HourlyRate
Display “Please enter regular hours worked”
Input RegHours
Display “Please enter overtime hours worked”
Input OvertimeHours
End User Input Module
Gross Pay Module
GrossPay = RegularHours * HourlyRate + OvertimeHours * (HourlyRate * 1.5)
End Gross Pay module
Tax Module
Tax=GrossPay*.30
End Tax Module
Net Pay Module
NetPay = GrossPay –Tax – Parking
End Net Pay Module
Display Module
Display “Gross pay is”GrossPay “for”EmplyeeID“.”
Display “Net Pay is”NetPay“for”EmployeeID“.”
Close Display Module
Programming Problem 4
Main Module
Declare Score1 As Real
Declare Score2 As Real
Declare Score3 As Real
Declare Score4 As Real
Declare Score5 As Real
Declare Score6 As Real
Declare PlayerOneAvg As Real
Declare PlayerTwoAvg As Real
Declare GameAverage As Real
Display “Welcome to Bowling Average”
Call User Input Module
Call Player Average Module
Call Game Average Module
Call Display Module
End Main Module
User Input Module
Display “Please enter score for player 1 game 1”
Input Score1
Display “Please enter score for player 2 game 1”
Input Score2
Display “Please enter score for player 1 game 2”
Input Score3
Display “Please enter score for player 2 game 2”
Input Score4
Display “Please enter score for player 1 game 3”
Input Score5
Display “Please enter score for player 2 game 3”
Input Score6
End User Input model
Player Average Module
PlayerOneAvg=(Score1+Score3+Score5)/3
PlayerTwoAvg=(Score2+Score4+Score6)/3
End Player Average Module
Game Average Module
GameAverage=(PlayerOneAvg+PlayerTwoAvg)/2
End Game Average Module
Display Module
Display “Player One’s average score is”PlayerOneAvg“.”
Display “Player Two’s Average score is”PlayerTwoAvg“.”
Display “The combined average of the games is”GameAverage “.”
End Display Module
Programming Problem 5
Main Module
Declare LoanAmt As Real
Declare InterestRate As Real
Declare NumberMonths As Real
Declare MonthlyRate As Real
Declare Payment As Real
Display “Welcome to Payment Calcultor.”
Call User Input Module
Call Monthly Rate Module
Call Payment Calculation Module
Call Display module
End Main Module
User Input Module
Display “Enter loan amount please.”
Input LoanAmt
Display “Enter interest rate please.”
Input InterestRate
Display “Enter number of monthly payments desired please.”
Input NumberMonths
End User Input Module
Monthly Rate Module
MonthlyRate = InterestRate/1200
End Monthly Rate Module
Payment Calculation Module
Payment = LoanAmt * MonthlyRate * (1 + MonthlyRate)^NumberMonths ÷ ((1 + MonthlyRate)^NumberMonths – 1)
End Payment Calculation Module
Display module
Display “Your monthly payment will be” Payment “.”
End Display Module
You May Also Find These Documents Helpful
-
Display "This program will break down the weight of an item from pounds to ounces, and will then give you the price per ounce for the product listed."…
- 304 Words
- 3 Pages
Good Essays -
{ Console. Write("Enter score for {0}: ", player[counter]); score[counter] = Convert. ToInt32(Console. ReadLine()); counter++; } } while (addName != 1); return counter; } static void DisplayPlayerData(ref string[] playerName, ref int[] playerScore,int counter) { for (int i = 0…
- 363 Words
- 2 Pages
Satisfactory Essays -
User 's total compensation // Display welcome message System.out.println("Hello, welcome to the Simple Commission " + "Calculator.") ; // Insert a blank line System.out.println(); // Create a Scanner object to read input Scanner keyboard = new Scanner(System.in); // Get user credentials System.out.println("Please enter your first name.") ; firstName = keyboard.nextLine(); System.out.println("Please enter your last name.")…
- 1025 Words
- 5 Pages
Good Essays -
c. Modify the program of Part b so that at the option of the user, it displays…
- 300 Words
- 2 Pages
Good Essays -
Putting the values into the excel function PMT(rate, nper, pv, [fv], [type]), one gets the yearly payment amount PMT = $84.14.…
- 1735 Words
- 7 Pages
Powerful Essays -
Design an algorithm that prompts the user to enter his or her height and stores the user’s input in a variable named height.…
- 534 Words
- 3 Pages
Good Essays -
An accumulator is used to keep a running total of numbers. In a loop, a value is usually added to the current value of the accumulator. If it is not properly initialized, it will not contain the correct total.…
- 457 Words
- 4 Pages
Satisfactory Essays -
What is the value inside the "value" variable at the end of the given code snippet?…
- 2831 Words
- 12 Pages
Good Essays -
The task at hand is to design a program, using pseudocode, which will calculate the square feet of a house with no more than four rooms. It must be additionally assumed that each of these rooms is rectangular. The required output is the accurate calculation of the aggregate square footage of these rooms. The required input to arrive at this output is the length and width of each of the rooms, the multiplication of each individual room length and width, and the sum of the combined multiplication results. The required output will be obtained through proper declaration of each variable, which consists of multiple floating point values. For my analysis the length of a room will be represented as L plus a number to identify the room, such as L1. The width will similarly be represented as W1, and the area, or length times width, as A1. The resulting output, or sum of all A values, will be calculated. The following is a list of the required input and resulting output.…
- 703 Words
- 3 Pages
Satisfactory Essays -
package retail.calculator; import java.awt. *; import java.awt.event. *; import java.text. DecimalFormat; import javax.swing. *; public class RetailCalculator extends JFrame { //create ojects JLabel department; JLabel number; JLabel name; JLabel price; JLabel discount; JLabel sale; JComboBox dept; JTextField itemNum; JTextField…
- 340 Words
- 2 Pages
Satisfactory Essays -
emp[2] = new Hourly("Kate", "Perry", 'F', 0, 75, 25, new Benefit("Partial", 3000, 8), "part time");…
- 509 Words
- 3 Pages
Satisfactory Essays -
; stdcall procedure names must be be also decorated by "@" and size of arguments at the end…
- 701 Words
- 3 Pages
Good Essays -
A list of the renewals due within the next month, with total payment due if all members renew their membership…
- 1203 Words
- 5 Pages
Powerful Essays -
The data required to compute the use charge are listed. We separate the involved data categories into Input, Process and Output.…
- 435 Words
- 2 Pages
Good Essays -
1 import javax.microedition.midlet. *; import javax.microedition.lcdui. *; public class Calculator extends MIDlet implements CommandListener { private Display dsp; private Form fm; private TextField tf1,tf2; private StringItem sitres; private ChoiceGroup cg; private Command cmdq,cmdcalc,cmddate; public Calculator() { fm=new Form("Calculations"); tf1= new TextField("Number1:","",3,TextField. NUMERIC); tf2= new TextField("Number2:","",3,TextField. NUMERIC); sitres=new StringItem("Result",""); cg=new ChoiceGroup("Operation",ChoiceGroup.EXCLUSIVE); cg.append("Add",null); cg.append("Subtract",null); cg.append("Mul",null); cg.append("Div",null); cmdq=new Command("Quit",Command.…
- 4143 Words
- 17 Pages
Good Essays