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

Answers

Answer 1

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 Are Working On A Ticketing System. A Ticket Costs $10. The Office Is Running A Discount Campaign:

Related Questions

No links it’s just a normal question about iPhones.
If you have someone in your contacts you talk with a lot but like everyday you delete the conversation multiple times will you stop receiving texts from that person even if you text them and it says delivered?

Answers

Answer:

You will still get the messages. You are just deleting the messages from YOUR device not the other persons, in order to stop recieving messages from the person you block them. In order to stop receving notifications, you put them on DND. But, if you talk to them everyday I would assume you would not want to stop receiving messages from them.


What requirements are necessary in order for you to share a file?
Check all that apply.
You own it.
You commented on it.
You can edit.
You know about the topic of the document.

Answers

Answer:

I. You own it.

II. You can edit.

Explanation:

A file can be defined as a computer resource that avails end users the ability to store or record data as a single unit on a computer storage device.

Generally, all files are identified by a name and type such as audio, image, video, document, system, text, etc. Each type of files can be transferred or send from one computer node to another computer node through the use of a wired or wireless connection and with the necessary level of permission.

The requirements which are necessary in order for you to share a file are;

I. You must own the file. This simply means that you have the authority to share the file and have it saved on your device.

II. You have the permission or required credentials to edit the file. A read-only permission cannot be used to edit a file but a full permission can be used.

Consider the classes below: Which of the following statements is true? Group of answer choices The value of counter will be different at the end of each for loop for each class. The value of j will be the same for each loop for all iterations. Both The value of counter will be different at the end of each for loop for each class and The value of j will be the same for each loop for all iterations are true. Neither The value of counter will be different at the end of each for loop for each class nor The value of j will be the same for each loop for all iterations is true.

Answers

Answer:

probly

Explanation:

Both The value of counter will be different at the end of each for loop for each class and The value of j will be the same for each loop for all iterations are true.

Other Questions
dillon pays x dollars to get a haircut. he gives the stylist a 15% tip. the expression representing his total cost is x + 0.15x I dont understand it help and add a explanation for me pls :} Given b=4, c=1, A=120 for a triangle with sides a, b, c and angles A, B, C. What is the area of the triangle? Round to the nearest hundredth. Given a parent genotype of Bb, what are the possible gametes that they can produce? Paragraph 21:Despite the legion of fans that have followed her for years, Schwermer has met her fair share of critics. After a trainwreck appearance on Italian talk show RAI TV, she stopped doing television interveiws (in one taping, a host actually rifled through her suitcase.)Part A: Which idea does the author present by including the word anecdote in paragraph 21 about Ms. Schwermer's television appearacne? A) Ms. Schwermer's fame has spread beyond her native Germany. B) Ms. Schwermer has had to deal with criticism from others. C) Ms. Schwermer's new life has drawbacks, just like her old life. D) Ms. Schwermer is seizing the opportunity to influence others.Part B: Which detail from the article best suports the answer to Part A?A) She decides to stop doing television interviews after a negative experience. B) She avoids her friends out of fear of their disapproval. C) She is constantly moving around and meeting new people. D) She has a large group of followers who support her lifestyle choice.Please, Please, Please Help. I need help really bad. Q12. Which relation is a function?A {(-1, 3), (-2, 6), (0, 0), (-2, -2)}B {(-2, -2), (0, 0), (1, 1), (2, -2)}C {(7, 4), (8, 8), (10, 8), (10, 10)}D {(4, 0), (4, 1), (4, 2), (4, 3)} Add coefficients to balance the equation to make water.H2(g) +O2 (g)H20 (1) Identify the phrases AND what type of phrase. Juan was writing his paper, while his sleeping dog napped by his feet. helppppp! how do I find this? Enter the values for the highlighted variables tocomplete the steps to find the sum:azb =3x 9+2x - 6 6 - 2xCEd =3 x9+2x-6 al 2x-6)3x b.+2x-6 2x - 63 2x-6d{x - e)f(x-3)= 9e =f=IIIg=DONE HELP ME WITH THIS PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Which of the following was NOT a cause of the Cold War between the UnitedStates and the Soviet Union? *A. The U.S. was capitalist while the Soviet Union was communistB. U.S. secrecy about the Atom BombC. The Soviets refusal to allow free election in Eastern Europe after WWII.D. The Japanese attack on Pearl Harbor I went to............church to observe it's architecture.(a,an,the) 2.3.6 Analyze Gothic Elements in LiteratureRead this sentence from the opening paragraph of "The Black Cat":But to-morrow I die, and to-day I would unburthen my soul.Why does Poe place this line near the beginning of the story?A. To provide an unusual setting that prepares the reader for frighteningeventsXO B. To set a quick pace so that readers know the story will have a lot ofactionC. To make the reader aware that this story is an example of GothicliteratureD. To foreshadow events to come and make the reader wonder what thenarrator has donelol PLEASE HELP THANK YOU BRANLIEST IS PROVIDED I NEED HELP ASAP! why was the landmark case Briggs v. Ellliot important Helpppp chile. Im stuck sidnfifnfig vkfniffnf What is the answer to number 2?? susan has a total of 31 books. amy has four less than seven times the number of books compared to susan. write an equation for this situation. Use cosine law to find the value of x. Show working. use ^ for power and sqrt for square root