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]
3 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]3 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
Calculating mean for even number and use while loop<br>pleas help me ​
vladimir2022 [97]

Answer:

Here is my answer in Javascript

num = 0;   // Use to calcate the even numbers

loop = 10; // Use for the highest even number that will be calcated for

index = loop/2; // Calcate the size of the array based upon how many loops their

let arr = [index]; //Create array to store the even numbers

let i = 0; // Use to keep track of which on what number in the while loop we are on  

let total = 0; //Used to add up all of the even numbers

let mean = 0; //Used to calcate the mean of all even numbers

do {

 i = i + 1; //Keep track of what loop we are on

 num = num + 2; //Used to calcate the even number

 arr.push(num); //Push the num into a array

 total = total + arr[i]; //Calcate the total of the array

 mean = total / i; //Calcate the mean

}

while (num != loop);

//Output the result

console.log(mean);

8 0
3 years ago
What can I play to get max points
BaLLatris [955]

Answer:

H o e! (as the gardening tool)

3 0
3 years ago
Read 2 more answers
Which are the benefits of leveraging web technologies?
allsm [11]

Lower cost - You can leverage web technologies like FB and Google which allow you to advertise and reach billions of users relying on their services at a very low cost as compared to other mediums.  

Security – Data stored with web technology companies offers more security because it is stored in huge data centers that have high-end protection

Increase business efficiency – Web technologies can increase business efficiency and unlock value in your business functions. They can reduce time, provide critical analytics and help your business grow.

4 0
4 years ago
Read 2 more answers
Sam's manager would like him to share what he learned at a conference. He needs to share the information with twenty coworkers a
murzikaleks [220]

C or D 70% i am sure of it

3 0
3 years ago
Read 2 more answers
A plain text e-mail and the same text entered into a word processing document would be about the same file sizes.
kumpel [21]
The email should be lighter but they're variables such as the word processing program. Not sure if this answered your question.
6 0
4 years ago
Read 2 more answers
Other questions:
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    15·1 answer
  • The rubric given to them by their teacher requires that
    14·1 answer
  • The company involved in an attack by Oleg Zezev from Kazahkstan, in which Zezev accessed computer data and copied personal infor
    12·1 answer
  • Tim is trying to explain to his aunt how her computer works, but she does not understand what a CPU does. Which description will
    6·2 answers
  • How do I change my keyboard's debounce time?
    15·2 answers
  • Can a msi b450 tomahawk motherboard fit into a darkflash dlm21 mesh micro atx tower
    13·1 answer
  • In the Word 2016 window, where is the Status bar located?
    11·1 answer
  • Generally, the more secure the system, the less usable it becomes. <br> O True O False
    9·2 answers
  • Information systems include all of these
    5·1 answer
  • 80billion +2 TRILLION . PLEASE AWNSER
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!