1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aleksklad [387]
3 years ago
7

A retail score grants its customers a maximum amount of 1:rcdit. Each customer's available credit is his or her maximum amount o

f credit miniJS the amount of credit used. Write a pseudocode algorithm for a program that asks for a customer's maximum amount of credit and amount of credit used. The program should then display the customer's available credit.

Computers and Technology
1 answer:
GuDViN [60]3 years ago
4 0

Answer:

Pseudocode algorithm:

Start

Declare variables maxCredit, usedCredit and availableCredit

PRINT "Enter the customer's maximum amount of credit"

READ maxCredit

PRINT "Enter the amount of credit the customer has used "

READ usedCredit

COMPUTE availableCredit = maxCredit - usedCredit

PRINT availableCredit

End

The above psedudcode can also be written as

Declare variables maxCredit and usedCredit

Display"Enter the customer's maximum amount of credit"

READ maxCredit

Display"Enter the amount of credit the customer has used "

READ usedCredit

COMPUTE availableCredit = maxCredit - usedCredit

Display availableCredit

Explanation:

The above pseudocode algorithm first declares two variables maxCredit and usedCredit.

Then in order to take customer's maximum amount from user it displays a message "Enter the customer's maximum amount of credit". Then it reads the value of maxCredit entered by the user.

Then in order to take value of amount of credit used from user, it displays a message "Enter the amount of credit the customer has used ". Then it reads the value of usedCredit entered by the user.

This is the requirement of the question. I have written the further part of algorithm to compute the available credit. The available credit is computed by subtracting maximum amount of credit and the amount of credit used i.e. availableCredit = maxCredit - usedCredit.

At the end the result of this subtraction is stored in availableCredit and value of availableCredit is displayed using PRINT availableCredit.

The corresponding C++ program of the above pseudocode algorithm is as following:

#include <iostream>  //to use input output functions

using namespace std;   // to identify objects like cin cout

int main()  {  // start of main() function body

double maxCredit, usedCredit, availableCredit;   // declare variables

//prompts user to enter the value of  maximum credit

cout << "Enter the customer's maximum amount of credit: ";

cin >> maxCredit;  //reads the value of maximum credit from user

//prompts user to enter used credit

cout << "Enter the amount of credit used by the customer: ";

cin >> usedCredit;  //reads the used credit value from user

availableCredit = maxCredit - usedCredit;  //computes available credit

cout << "The customer's available credit is: ";  //displays this message

cout << availableCredit; } //displays the value of computed available credit

//The output is attached in screenshot

You might be interested in
An Acceptable Use Policy (AUP) are designed for the purpose of _____.
Vladimir79 [104]

Answer:

maximizing processing power

7 0
3 years ago
What does the word tolerance mean in textiles?
Firdavs [7]
It means the willingness to respect or except thecustoms, beliefs, or opinions of others
4 0
3 years ago
JAVVVAAAAAA HELPPPP EDHESIVE ​
Mekhanik [1.2K]

Answer:

Here's some really bad code that works:

public static double average(int a, int b, int c, int d, int e)

{

return (((double)a + b + c + d + e) / 5);

}

5 0
3 years ago
How many panes can Pablo view in a spreadsheet if he chooses the split worksheet option?
ddd [48]
Pablo can be a minimum of two pains and a maximum of four panes in a split screen worksheet.
6 0
3 years ago
Read 2 more answers
4. What are five actions you should do to care for your camera?
den301095 [7]
Adding to the one above,
Keep food or drinks away from the camera
7 0
3 years ago
Other questions:
  • Write a paragraph on the orgin or development of ONE of the following elementss of the Internet:
    15·1 answer
  • What is primary storage
    11·2 answers
  • Which technology can allow a single ground-based telescope to achieve images as sharp as those from the Hubble Space Telescope?
    7·1 answer
  • What is the output of 1101 x 10 == 11000 + 10?
    12·1 answer
  • Write a program that takes a decimal number from the user and then prints the integer part and the decimal part separately. For
    13·1 answer
  • Select three advantages to using digital video.
    5·2 answers
  • This can change the fit of your respirator. A) A mustacheB) A beardC) Weight gainD) All of the above
    15·1 answer
  • The process of bringing data or a file from one program to another is called
    5·2 answers
  • What do people in the movie e.t think about the character E.T
    9·1 answer
  • Find out about the different technological solutions available for interconnecting LANs to from larger networks such as wide are
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!