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
Data is best described as
viktelen [127]

Answer:

The answer is B

Explanation:

TOOK THE TEST

5 0
3 years ago
Read 2 more answers
Create a query that returns School Name, School Dean Last Name, School Dean First Name, Department Name, Department Chair Last N
Zepler [3.9K]

Answer:

SELECT  School_name,School Dean Last Name, School Dean First Name,Department Name, Department Chair Last Name, Department Chair First Name

FROM table_name

ORDER BY School Name,Department Name

8 0
2 years ago
Read 2 more answers
What is the common name for the growth rate function N?
kolezko [41]

Answer:

Linear.

Explanation:

The common name for the growth rate function N is linear.N growth rate is directly proportional to the input.So it grows linearly.It does not grow rapidly like other growth functions like quadratic,exponential and cubical.

Constant growth does not grow over time it stays as it is.

Hence the answer to this question is linear.

3 0
3 years ago
Write the ARMv8 instructions for the following c code. Assume that the argumentsare stored in X0 onward in the order they are pr
klio [65]

Answer:

labelAdd:

add x0, x0, x1

mov pc, lr

Explanation:

  • Create a method called labelAdd.
  • Store the result in x0 by adding the value in the registers x0, x1.
  • Return to caller.
3 0
2 years ago
Which type of front usually brings thunderclouds and storms
IrinaVladis [17]
Your anwser will be d
5 0
3 years ago
Read 2 more answers
Other questions:
  • In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends deci
    7·2 answers
  • In this assignment, you are going to add conditional formatting to the spreadsheet you used in the previous
    13·1 answer
  • What is the purpose of inserting SmartArt in a Microsoft Office program? (1 point)
    11·2 answers
  • Web beacons are tiny, invisible software programs hidden in email messages and web pages that are used to track and report a use
    14·1 answer
  • Design a class named QuadraticEquation for a quadratic equation ax^2+bx+x=0. The class contains: **private data fields a, b, and
    11·1 answer
  • Explain how SEO impacts the way you should interpret search engine results ???
    6·1 answer
  • Wesley purchased a word-processing software program. He used it for a year, during which he got regular updates every two months
    9·1 answer
  • Why is operating system important software for computer?give 3 reasons
    8·1 answer
  • Microsoft word 2010 lab 6-1
    7·2 answers
  • KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!