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
You decide to configure ntp on the router to get time ntp server with an ip address of 172.17.8.254 which commanda should you us
Morgarella [4.7K]
Telenet into the router, authenticate and type enable once the prompt is back type ntp server 172.17.8.254 do this on all routers.
4 0
3 years ago
Gmod how to make someone admin on a lan server
andrezito [222]
In case you're playing on a local multiplayer server

There is no such thing as admin on a normal local server. You're able to do everything.

In case you're playing on a dedicated server

<span>In the server command prompt, make a RCON command which states: ulx adduser <your user name> superadmin. This will add you as superadmin, using the </span><span>ULX admin addon.</span>
4 0
3 years ago
Read 2 more answers
90 POINTS Hazel is working with a database to help determine if the company she works for is making or losing money. Hazel has o
VikaD [51]

Answer:

a

Explanation:

5 0
2 years ago
Read 2 more answers
List three types of Software:
Elodia [21]

Answer:

ummm

Explanation:

Freeware

Open Source

Shareware

5 0
3 years ago
This is a glitch ? 


 










































mixer [17]

Answer:

I think no...Brainly might not allow unique text's.

8 0
3 years ago
Other questions:
  • Which of the following is NOT a group on the Slide Master tab?
    6·1 answer
  • This toolbar has icons representing the application's basic operations such as Save and Copy. Drawing Formatting Standard Task
    11·2 answers
  • If you place a semicolon after the test expression in a while loop, it is assumed to be a(n) ________. a. pre-test loop b. post-
    9·1 answer
  • The _______ of a secondary storage device indicates how much data the storage medium can hold.
    13·1 answer
  • Should I Buy a 2070 super or 2060 super
    6·1 answer
  • write a script to check command arguments. Display the argument one by one (use a for loop). If there is no argument provided, r
    6·1 answer
  • Write the definition of a function that takes as input three numbers. The function returns true if the floor of the product of t
    11·1 answer
  • Describe the different non-printing characters,​
    11·1 answer
  • What are the benefits and drawbacks of a desktop utilising virtualisation and a server?
    12·1 answer
  • Define a function FindLargestNum() with no parameters that reads integers from input until a negative integer is read. The funct
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!