1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
CaHeK987 [17]
2 years ago
5

You are working on a ticketing system. A ticket costs $10. The office is running a discount campaign: each group of 5 people is

getting a discount, which is determined by the age of the youngest person in the group. You need to create a program that takes the ages of all 5 people as input and outputs the total price of the tickets. Sample input: 55 28 15 38 63 sample output: 42.5 the youngest age is 15, so the group gets a 15% discount from the total price, which is $50 - 15% = $42.5
Computers and Technology
1 answer:
cupoosta [38]2 years ago
8 0

Answer:

Explanation:

The following program is written in Java. It takes 5 inputs of int values for the ages of each member in the group. Then it loops through all of the ages and chooses the youngest age. Finally, it applies that age as a discount to the final price which would be $50, outputting the final discounted price. The output for the test case provided can be seen in the attached picture below in red.

import java.util.Scanner;

class Brainly

{

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int[] person = new int[5];

       System.out.println("Enter age of individual 1: ");

       person[0] = in.nextInt();

       System.out.println("Enter age of individual 2: ");

       person[1] = in.nextInt();

       System.out.println("Enter age of individual 3: ");

       person[2] = in.nextInt();

       System.out.println("Enter age of individual 4: ");

       person[3] = in.nextInt();

       System.out.println("Enter age of individual 5: ");

       person[4] = in.nextInt();

       int youngest = person[0];

       for (int x = 0; x < person.length; x++) {

           if (person[x] < youngest) {

               youngest = person[x];

           }

       }

       double discount = 1 - (((double)youngest) / 100);

       double output = 50 * discount;

       System.out.println("Total Price: " + output + " the youngest is " + youngest);

   }

}

You might be interested in
Explain the characteristics of 1st generation computers​
levacccp [35]

Explanation:

i hope this is the right answer

!st generation computers were more big and bulky and you for sure could not bring them around everywhere.

8 0
3 years ago
Which steps of the management science process can either be a recommended decision or information that helps a manager a decisio
Step2247 [10]
Probably c or a with the question your asking
8 0
2 years ago
Who invented Satellites? What purpose does it serve? How has it impacted society today?
noname [10]

Answer:

Satellites have changed the way we experience the world, by beaming back images from around the globe and letting us explore the planet through online maps and other visuals. Such tools are so familiar today we often take them for granted. ... Satellites often offer hints about life on the ground, but not omniscience.

5 0
2 years ago
Read 2 more answers
Why was the first computer developed? a.) for personal use, b.) for military purposes, c.) for transportation, d.) for communica
IgorLugansk [536]
B) For Military Purposes but around the 1970s they became widely available to consumers.
5 0
3 years ago
How to make a 'Sign in with replit' button in replit (Node.js) will make brainliest
Y_Kistochka [10]

hit the sign in botten or create new account

3 0
3 years ago
Read 2 more answers
Other questions:
  • JavaScript
    10·1 answer
  • What does CTR stand for?
    10·2 answers
  • A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
    6·1 answer
  • Consider the following statements: #include #include class Temporary { private: string description; double first; double second;
    9·1 answer
  • How would you convert an integer value to a float value in Python?
    10·1 answer
  • In C#Write the program SubscriptExceptionTest in which you use an array of 10 doubles. Write a try block in which you place a lo
    5·1 answer
  • **NEED HELP??!! Computer Science Questions!! KNOWING GIMP!!!!
    7·1 answer
  • Which of the following is an example of a long-term goal?Developing a lifetime savings plan
    11·1 answer
  • I need some asap pls
    9·2 answers
  • You manage a network that uses switches. In the lobby of your building, there are three RJ45 ports connected to a switch. You wa
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!