Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

pseudocode pseudocode pseudocode conn e minimum bid is less than or equal to the

ID: 3750925 • Letter: P

Question

pseudocode pseudocode pseudocode conn e minimum bid is less than or equal to the amount entered by ton in Phone Company charges customers a basic rate of s5 d. A program that auction in which the length is bet program that prompts the user for a maximum reqult continuously accepts auction data and displays data for every aen 6. The Dash Cell Phone Companyc send text messages. Additional rates are as follows The first 60 messages per month, regardless of message length, are incly the basic bill. ° An aditional five cents is charged for each text message after the 60th m up to 180 messages An additional 10 cents is charged for each text message after the 180th mess Federal, state, and local taxes add a total of 12 percent to each bill. Design a flowchart or pseudocode for the following: a. A program that accepts the following data about one customer's messages: area co b. A program that continuously accepts data about text messages until a sentin c. A program that continuously accepts data about text messages until a sentin d. A program that continuously accepts data about text messages until a senti (three digits), phone number (seven digits), and number of text messages sent. Disp all the data, including the month-end bill both before and after taxes are added. value is entered, and displays all the details. value is entered, and displays details only about customers who send more th 100 text messages value is entered, and displays details only about customers whose total billiw taxes is over $20. m that prompts the user for a three-digit area code from which e. ils. Then the program continuously accepts text message data until a is entered, and displays data only for messages sent from the speci to va

Explanation / Answer

Solution /Pseudo code for part (a)

1. ACCEPT AREA _CODE, PHONE _NUM AND NUM_ OF_MSG SENT

2. CALL FUNCTION CALCULATE_BILL (NUM_ OF_MSG) AND STORE OUTPUT IN BILL

3. CALL FUNCTION NET_BILL(BILL) AND STORE OUTPUT IN TOTAL_BILL

4. DISPLAY AREA _CODE, PHONE _NUM, NUM _OF _MSG, BILL AND TOTAL_BILL

CALCULATE_BILL(NUM_ OF_MSG)

1. CHECK CONDITION

IF NUM_ OF_MSG <= 60

BILL = 5;

ELSE IF NUM_ OF_MSG >60 AND NUM_ OF_MSG <= 180

BILL = 5 + (NUM_ OF_MSG - 60) * 0.05 ;

ELSE

BILL = 5 + 120 * 0.05 + (NUM_ OF_MSG -180)*0.01

NET_BILL ( BILL)

1. TOTAL_BILL = BILL + (BILL * 0.12)

2. RETURN  TOTAL_BILL

EXPLANATION

CALCULATE_BILL WILL CALCULATE BILL WITHOUT TAXES . IT WILL ACCEPT NUMBER OF MESSAGES SENT AND CALCULATE BILL AND RETURN . BASED ON THE DIFFERENT CONDITIONS LIKE IF THE MESSAGES SENT ARE LESS THAN OR EQUAL TO 60 THEN THE CUSTOMER WILL BE CHARGED $5 PER MONTH .

IF THE MESSAGES ARE GREATER THAN 60 BUT LESS THAN 180 THEN FOR EACH TEXT MESSAGE 5 CENTS WILL BE ADDED IN THE BILL . FOR THIS CONDITION WILL BE  

BILL = 5 + (NUM_ OF_MSG - 60) * 0.05

5 REPRESENTS AMOUNT FOR FIRST 60 MESSAGES

(NUM_ OF_MSG - 60) * 0.05 REPRESENTS REMAINING MESSAGES THAT IS BEYOND 60 BUT LESS THAN OR EQUAL TO 180 MULTIPLIED BY 0.05 [ $1 = 100 CENTS, 5 CENTS = $ 0.05]

IF THE MESSAGES ARE GREATER THAN 180 THEN CONDITION WILL BE :

5 + 120 * 0.05 + (NUM_ OF_MSG -180)*0.01

5 = COST FOR FIRST 60 MESSAGES

120 * 0.05 = COST OF MESSGAES BEYOND 60 BUT LESS THAN OR EQUAL TO 180 .

IN THIS CONDITION TOTAL MESSAGES WOULD BE 180 OUT OF WHICH FOR FIRST 60 WE HAVE ALREADY ADDED $5 SO THIS WILL CALCULATE COST FOR REMAINIG [180-60 ]

(NUM_ OF_MSG -180)*0.01 = COST OF MESSAGES ABOVE 180 CALCULATED AS PER 10 CENTS FOR EACH MESSAGE [ $1 = 100 CENTS , 10 CENTS = $ 0.1 ]

NET_BILL WILL CALCULATE TOTAL BILL THAT IS BILL WITH TAXES

TAX = 12%

THEREFORE , TOTAL_BILL = BILL + (BILL * 0.12)