Top-Rated Free Essay
Preview

Programing Problems

Good Essays
721 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Programing Problems
IT 210

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

  • Powerful 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
  • 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
  • Satisfactory Essays

    Cs Programming Chapter 1

    • 2450 Words
    • 10 Pages

    ____ data items may involve organizing or sorting them, checking them for accuracy, or performing calculations with them.…

    • 2450 Words
    • 10 Pages
    Satisfactory Essays
  • Good Essays

    Intro to programming

    • 534 Words
    • 3 Pages

    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
  • Satisfactory Essays

    Code for an Infinite Loop

    • 457 Words
    • 4 Pages

    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
  • Good Essays

    C++ Midterm

    • 2831 Words
    • 12 Pages

    What is the value inside the "value" variable at the end of the given code snippet?…

    • 2831 Words
    • 12 Pages
    Good Essays
  • Satisfactory Essays

    Retail Calculator

    • 340 Words
    • 2 Pages

    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
  • Satisfactory Essays

    CMIS102 Homework1

    • 703 Words
    • 3 Pages

    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
  • Good Essays

    PLF - Program Design

    • 819 Words
    • 5 Pages

    Boolean searching is based on an algebraic system of logic formulated by George Boole, a 19th century English mathematician. In a Boolean search, keywords are combined by the operators AND, OR and NOT to narrow or broaden the search (you do not have to enter them in capitals).…

    • 819 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    BIOS and CMOS are two terms that many people think they know but cannot differentiate between. BIOS and CMOS are two different and distinct things in a computer, but being closely related, they are spoken of almost interchangeably. BIOS (basic Input Output System) is a program containing instructions for the start up of a computer, whereas CMOS (complimentary metal oxide semiconductor) is where all this BIOS information such as date, time, and system configuration details that are needed to start the computer are stored. Yes, they are closely related and perform very important functions at the startup of a computer but they cannot be more dissimilar also. Let us find the difference between BIOS and CMOS that seems to be so very confusing. In the simplest of terms, BIOS is a computer program that controls the computer when you switch on the power until the time the operating system of the computer takes over. Since BIOS is a firmware, it cannot store even this small bit of information, and CMOS it is that is used by BIOS to store the variable data.…

    • 456 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    xxxxxxxx

    • 509 Words
    • 3 Pages

    emp[2] = new Hourly("Kate", "Perry", 'F', 0, 75, 25, new Benefit("Partial", 3000, 8), "part time");…

    • 509 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    ; stdcall procedure names must be be also decorated by "@" and size of arguments at the end…

    • 701 Words
    • 3 Pages
    Good Essays
  • Powerful 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
  • Good Essays

    J2Me Coding

    • 4143 Words
    • 17 Pages

    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
  • Good Essays

    Electric Billing System

    • 435 Words
    • 2 Pages

    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

Related Topics