Free Essay

Psudocode for for Program 4

In:

Submitted By Devosmind
Words 272
Pages 2
Pseudocode for Java Assignment/program #4 Version 1.0

import java.util.ArrayList import java.util.Scanner

main()
{
Declare one dimensional array named Array1[]as double Declare a variable to hold the Name as String Declare/initialize base salary to 25,000 (from Program #3) Declare/initialize target sales to 120,000 (from Program #3) Declare annual sales variable as double Declare Total compensation as double create employee annual sales input via Scanner Input Name of salesperson - Name = keyboard.next() Print salesperson’s name and salary (25,000) Input annual sales from the user through the keyboard Input annual Sales amount from user if annual sales < 120000 { Print annual compensation is 25,000 } else if(annual sales > 120000 and annual sales < 150000 (from table in Program #3) } incentives = (annual sales * 0.10) Total compensation = salary + incentives Print the total compensation { else if (annual sales > 150000) { AccIncentives = (annual sales – 150000) * 1.25 Incentives = (Annual Sales + AccIncentives) * 0.10 Total Compensation = salary + incentives }

Input second person’s salesperson’s name Input second sales person’s annual salary

If (Total compensation > second sales person’s annual salary) { Print “you made more money than the second sales person” } Elseif (Total Compensation < second sales person’s annual salary { Results = second sales person’s salary – Total compensation first sales person + 1 Create an array object ex Array1 = new double[3] Array1[0] = Total compensation //assigns value to array Array1[1] = salary from second sales person Array2[2] = Results For ( counter = 0; counter > Array1.length; counter++) { Print counter and Array1[counter] Printf “you need to make this much more” + Results } // End of the for() method } } // End of main() method

Similar Documents

Free Essay

Home Maintenance Program

...Home Maintenance Program Nicole Chambers Andy Labance Pharia Reed 8/26/2014 PRG/221 James Johnson Have you ever finished cleaning your house, sat down to relax and then suddenly remember ‘I forgot to mop the floors’? Using this program will ensure that missing a step while cleaning your home is a thing of the past. We are going to use cleaning the kitchen as our example, and the way this program works is it will tell you in a sensible order to complete all of the required cleaning tasks to clean your kitchen properly, so that you’re not i.e. cleaning the floors then wiping counters and messing up the floors again. ABOUT THE PROGRAM: The first step this program tells you to do would be to wash the dishes, the program will prompt you to answer whether or not you have washed all of the dishes, if you answer no the program will tell you that you must wash the dishes in order to proceed to the next task and then prompt you to answer if you have washed the dishes. The program will continuously repeat this process until you answer ‘yes’ all of the dishes have been washed. After you answer ‘yes’ all of the dishes have been washed the program will tell you to proceed on to the next task of wiping down and sanitizing the counter tops. If in the beginning (the first time you are prompted to answer if the dished have been cleaned) you answer ‘yes’ all of the dishes have been washed this program will the direct you to proceed to completing the next task of...

Words: 782 - Pages: 4