You are on page 1of 6

Defense In Computer Programming

Submitted by: Cheeno Milo Peregrine Valdez Neil Ian Philip Ramirez Mark Clinton Paraon Juan Fernandez Submitted to: Prof. May Garcia

INPUT: number of words of a telegram PROCESS: words<=10 words >10 words = $1.10 each additional word.95 words = $1.IF statement problem ‡ Suppose the cost of sending a telegram consists of a flat rate of $1.95 for the fist 10 words and $0.95 + ((words-10)*0.10) OUTPUT: cost of sending of a telegram . Prompt the user for the needed input and display the output with a appropriate label. Construct a program to compute and display the cost of sending a telegram if the number of words in the telegram is input from the keyboard.

5% is used.500 OUTPUT: salesperson·s commission commission=15%(sales amount) commission=7. Display on the screen the salesperson·s commission with an appropriate label and prompt the user for any needed input.500 or greater. a commission rate of 7. INPUT: sales amount PROCESS: sales amount>=$1.500 sales amount<$1. then a commission rate of 15% is used to calculate the salesperson·s commission.‡ Write a QBasic program to read in a salesperson·s sales for a weekly period from the keyboard if the sales amount is $1. Otherwise.5%(sales amount) .

0 Charge $3. Ride-in-a-Wreck Taxi charges $2. .XX INPUT: Charge PROCESS: . The output should appear as follows: CHARGE TABLE Distance 0.0 miles) and the charge for the trip.25 . with a title line and column headings.Looping Problems: 1. $XX. . that shows the number of miles traveled (in tenths of a mile from 0.1 0. Construct a ride charge table.1 to 20. Use PRINT USING statements to center the report exactly on ant should 80-column printout. 20.75 per ride (drop fee) plus $0.25 for each tenth of a mile a passenger is driven.00 $3.2 .

Construct a program that will generate a table showing the non-zero multiples of five from five to fifty. The output should appear as follows: Multiples of Five 5 10 15 . 50 INPUT: num PROCESS: num + 5 OUTPUT: . using the TAB function on an 80-column printout. Use a column heading to label the values displayed and center your output.

and years is the number of years of investing. Use a function to perform the calculation involved in the problem. rate is the interest rate (in decimal form). The program should prompt the user and read the capital desired.Function Problem: I. Construct a program to compute the yearly investment need to acquire an amount of capital in the future. Rate Process : Yearly investment = capital / (1+rate) ^ years Output : Yearly Investment . Display your results with a label in dollars and cents format. the yearly interest rate. The amount of money that must be invested yearly for a certain number of years at a specified interest rate to acquire an amount of capital can be determined by the following formula: Yearly Investment = Capital / (1+rate) ^Years Where capital is the desired capital at the end of the investment period. Number of Year/s . Input : Capital . and the number of years of investment to be processed from the program user.