Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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 XXXXXXXXXX= XXXXXXXXXXyear total number of products sold is 10+20=30 2-year combined selling price is 3000/30=100.00
Answered Same Day Mar 04, 2021

Solution

Neha answered on Mar 05 2021
146 Votes
51585/LargestSmallest.java
51585/LargestSmallest.java
import java.util.Scanner;
public class LargestSmallest {
  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 cu
ent = sc.nextInt();
      if (cu
ent > largest) {
        largest = cu
ent;
      } 
      if (cu
ent < smallest) {
        smallest = cu
ent;
      }
      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