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

1. The program asks for 3 natural numbers and outputs minimal number, sum of thi

ID: 3584756 • Letter: 1

Question

1. The program asks for 3 natural numbers and outputs minimal number, sum of this numbers and average among them. 2. Program asks price of one item and how many of them were sold and returns total amount of money to be paid. 3. Kate had only 3 euro, but she wants to buy N kilograms of apples (the price for 1kg is 0.24euro). The program asks to the user how many kilograms of apples want to buy Kate and outputs is it possible or not. 4. There are 2 flash drives: the old one with capacity N MB, and new one with capacity M GB, the program asks N and M and outputs how many times new flash drive is bigger than old (1GB=1024MB). 5. The program asks the speed v in km/h and transforms it to m/s. Please solve one program ...C , Java it doesnt matter

Explanation / Answer

import java.util.Scanner; public class ThreeNumbers { public static void main(String args[]) { ThreeNumbers tn = new ThreeNumbers(); Scanner keyboard = new Scanner(System.in); System.out.println("Enter first positive integer: " ); int a = keyboard.nextInt(); System.out.println("Enter second positive integer: " ); int b = keyboard.nextInt(); System.out.println("Enter three positive integer: " ); int c = keyboard.nextInt(); tn.printMin(a,b,c); tn.printSumAndAvg(a,b,c); } public void printMin(int a, int b, int c) { // minimum number int minimum = 0; if(a