Note: In each question, assume that the user enters correct inputs. You do not handle with exceptions.1. Let’s think that Company A produces mobile phones and you will write an application which...

1 answer below »
Note: In each question, assume that the user enters correct inputs. You do not handle with exceptions.1. Let’s think that Company A produces mobile phones and you will write an application which calculates the product selling price for each year and product combined selling price concerning the supplied years by the user. (8 pts) UPLOAD SellingPrice.javaPlease check the following requirements: a. You will create a sentinel-controlled while loop. The flag value will be (-1). b. You will ask for a sales revenue (int), or you will request the user to terminate the application. Display the flag-value in your message. c. If the user supplies a sales revenue input, then you will ask for the total number of products (int) for the related year. Display the number of the year while asking inputs and printing results. d. Calculate the product selling prince (double) for the related year and display it. Display two digits after the decimal point. e. When the user terminates the application: i. Calculate the total sales revenue (int) for all years and display it. ii. Calculate the total number of products sold (int) for all years and display it. iii. Calculate the combined selling price (double) and display it. Display two digits after the decimal point. iv. Display the number of the year in your messages.Sample Output 1. year product selling price is 1000/10 = 100.00 …. 2-year total sales-revenue is 1000+2000= 3000 2-year total number of products sold is 10+20=30 2-year combined selling price is 3000/30=100.00
Answered Same DayMar 04, 2021

Answer To: Note: In each question, assume that the user enters correct inputs. You do not handle with...

Neha answered on Mar 05 2021
144 Votes
51585/LargestSmallest.java
51585/LargestSmallest.java
import java.util.Scanner;
public class Larg
estSmallest {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int largest = Integer.MIN_VALUE;
    int smallest = Integer.MAX_VALUE;
    System.out.printf("Please enter 10 numbers %n");
    int i =0;
    while (i < 10) {
      int current = sc.nextInt();
      if (current > largest) {
        largest = current;
      } 
      if (current < smallest) {
        smallest = current;
      }
      i++;
    }
    System.out.println("Largest of all numbers is : " + largest);
    System.out.println("Smallest of all numbers is : " + smallest);
  }
}
51585/SellingPrice.java
51585/SellingPrice.j...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here