Question

Write an Algorithm in Pseudocode for the Exercises Below Add 5 numbers that a user enters...

Write an Algorithm in Pseudocode for the Exercises Below

  1. Add 5 numbers that a user enters by keyboard and display the Total on screen.
  2. Compute the area of a rectangle and display on screen based on length and width values that the user enters by keyboard.
  3. Compute the new price for a product that’s on sale for 10% off. Display new calculated price on screen. Assume current price is $25.00.
  4. Add the prices of an order of fries, a burger and a drink. Calculate the tax based on the sales tax rate that customer entered by keyboard and tell the customer their total on screen.
    Assume the following Beef-A-Roo prices: fries = $1.69, burger = $3.39, and drink = $1.69.
  5. Subtract 2 numbers user enters by keyboard. Display the following result text to the screen - If the result is positive, say “Positive”; if the result is negative, say “Negative”. If the result is 0, say “Zero”.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Add 5 numbers :

BEGIN

ARRAY arr[5], sum

FOR i = 0 to arr.length - 1

OUTPUT("ENTER NUMBER"+ (i + 1) + " : ")

INPUT arr[i]  

sum = sum + arr[i]

ENDFOR

OUTPUT sum

END

------------------------------------------------------------------------------------------------------------------------------

2. AREA OF RECTANGLE

BEGIN

NUMBER length, breadth

OUTPUT("ENTER LENGTH : ")

INPUT length

OUTPUT("ENTER BREADTH : ")

INPUT breadth

OUTPUT("AREA : " + (length * breadth ))

END

------------------------------------------------------------------------------------------------------------------------------------------

3. NEW PRICE AFTER TAX

BEGIN

NUMBER curr_price = 25.00, tax = 10

NUMBER new_price

new_price = curr_price + ( curr_price * ( tax / 100 ) )

OUTPUT new_price

END

--------------------------------------------------------------------------------------------------------------------------------------------------

4. ADD PRICE OF ORDERS

BEGIN

NUMBER fries_price = 1.69

NUMBER burger_price = 3.39

NUMBER drink_price = 1.69

NUMBER tax_rate, total_price

OUTPUT("ENTER TAXT RATE : ")

INPUT tax_rate

total_price = ( fries_price + burger_price + drink_price )+(( fries_price + burger_price + drink_price ) * tax_rate /100)

OUTPUT total_price

END

-----------------------------------------------------------------------------------------------------------------------------

5 Positive or negative numbers :

BEGIN

NUMBER num1, num2, result

OUTPUT ("ENTER NUM1 : ")

INPUT num1

OUTPUT ("ENTER NUM2 : ")

INPUT num2

result = num1 - num2

IF result > 0

  OUTPUT("POSITIVE")

ELSE IF result < 0

OUTPUT("NEGATIVE")

ELSE

OUTPUT("ZERO")

END

------------------------------------------------------------------------------------------------------------------------------

Add a comment
Know the answer?
Add Answer to:
Write an Algorithm in Pseudocode for the Exercises Below Add 5 numbers that a user enters...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 6. Write a program (compile and run), a pseudocode, and draw a flowchart for each of...

    6. Write a program (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the user types the...

  • c++ I am suppose to write a function that gets a number from a user, say...

    c++ I am suppose to write a function that gets a number from a user, say 3.123456789 and then the program gets another number from the user which is used to find out how many decimal digits we want rounded to. So if the user inputs 3 then the number would turn into 3.123 then we are suppose to add two digits next to the rounded number so it would turn into 3.12300. the rounding is suppose to be done...

  • Write a program that calculates the average of a stream of non-negative numbers. The user can...

    Write a program that calculates the average of a stream of non-negative numbers. The user can enter as many non-negative numbers as they want, and they will indicate that they are finished by entering a negative number. For this program, zero counts as a number that goes into the average. Of course, the negative number should not be part of the average (and, for this program, the average of 0 numbers is 0). You must use a method to read...

  • Please help me to do my assignment it should be python. Thank you Write a menu-driven...

    Please help me to do my assignment it should be python. Thank you Write a menu-driven program for Food Court. (You need to use functions!) Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!) Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs. Keep asking the user until he/she chooses...

  • Use both pseudocode and flowcharts to solve the problems below: 1. Write a program that converts...

    Use both pseudocode and flowcharts to solve the problems below: 1. Write a program that converts a user-entered Fahrenheit temperature to equivalent Celsius temperature. Use the formula c = (5 / 9) * (f - 32) where c is representing a Celsius temperature and f a Fahreinheit temperature. 2. A program is required that will read two operands and print the product to a file. 3. A program will ask the user to enter his/her name. Upon entering the name...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • :) Problem: ??? Your task: implement in CH the algorithm solution shown below. Then analyze it...

    :) Problem: ??? Your task: implement in CH the algorithm solution shown below. Then analyze it and explain, using just one or two sentences, what it does. Write this explanation as a comment at the top of your program. This explanation will be worth 5 points of your total grade. Do not be too detailed (for example, do not write it opens a file and then declares variables, and then reads from a file...), it should look like the problem...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

  • I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this p...

    I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this paper and some conclusions and contributes of this paper. I need this for my Finishing Project so i need this ASAP please ( IN 1-2-3 HOURS PLEASE !!!) Budgetary Policy and Economic Growth Errol D'Souza The share of capital expenditures in government expenditures has been slipping and the tax reforms have not yet improved the income...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT