Work through the three steps of decomposition, flowcharting, and pseudocode for the following example.
You have a store that sells apples and oranges. Apples are Rs. 10 each and oranges are Rs. 5 each. Your program should get from the user the numbers of apples and oranges and output the total amount of money.
Answers
Answered by
0
Answer: The required Java program :-
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter number of apples: ");
int apples = scan.nextInt();
System.out.print("Enter number of oranges: ");
int oranges = scan.nextInt();
scan.close();
System.out.print("Total amount of money = "+((10*apples)+(5*oranges)));
}
}
Please mark it as Brainliest.
Similar questions
Physics,
2 months ago
Math,
2 months ago
World Languages,
2 months ago
Science,
6 months ago
Math,
6 months ago
Social Sciences,
10 months ago
Science,
10 months ago
Geography,
10 months ago