In: Computer Science
Write pseudocode algorithms for the programs described as follows:- Available Credits A program that calculates a customer’s available credit should as the user for the following: The customers maximum amount of credit The amount of credit used by the customer Once these items have been entered, the program should calculate and display the customer’s available credit. You can calculate available credit by subtracting the amount of the credit used from the maximum amount of credit. (I need this in JAVA format please)
PSEDO CODE:
DECLARE MAX_CREDIT,USED_CREDIT,AVAILABLE_CREDIT
INPUT : MAX_CREDIT
INPUT: USED_CREDIT
AVAILABLE_CREDIT=MAX_CREDIT-USED_CREDIT
OUTPUT: AVAILABLE_CREDIT
import java.util.Scanner;
public class AvailableCredit {
public static void main(String[] args) {
Scanner sc = new
Scanner(System.in);
//reading the max credit
System.out.println("Enter the
maximum amount of credit: ");
double maxCredit =
sc.nextDouble();
//reading the used credit
System.out.println("Enter the
amount of used credit: ");
double usedCredit =
sc.nextDouble();
//finding available credit
double availableCredit = maxCredit
- usedCredit;
//printing all details
System.out.println("Maximum Credit
: " + maxCredit);
System.out.println("Used Credit : "
+ usedCredit);
System.out.println("Available
Credit : " + availableCredit);
}
}
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me