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
An existing document that you use as a starting point for a new document; it opens a copy of itself, unnamed, and then you use t
masha68 [24]

Answer:  

The answer is "Template".  

Explanation:  

  • Templates are multi-designed documents for desktop publishing. These templates can be used to generate business cards, brochures, greeting cards, and other desktop documents.
  • There are several types of templates, that include mixing and matching components and provides a wizard to select objects from the list that gathers a list and provide a final result.
7 0
3 years ago
When considering changing the content of a cell which button should you press to leave the cell as it originally was
Mashcka [7]

When considering changing the content of a cell you should press CTRL + Z to leave the cell as it originally was.

 

To undo an action just:

 

Press Ctrl+Z until you've fixed your mistake.

Or press Alt+Backspace to do the same thing.

If you prefer your mouse, click Undo on the Quick Access Toolbar.

5 0
3 years ago
Read 2 more answers
At the county fair, prizes are awat rded to the five heaviest cows. More than 2000 cows are entered, and their records are store
Sergeu [11.5K]

Answer:

B

Explanation:

selection sort for each pass sorts one element in right place . so we can stop it after 5 passes as we need only 5 heaviest cows info.

Answer is B

6 0
3 years ago
For this question you must write a java class called Rectangle and a client class called RectangleClient. The partial Rectangle
polet [3.4K]

Answer:

Java.

Explanation:

public class Rectangle {

   private int x;

   private int y;

   private int width;

   private int height;

   ///////////////////////////////////////////////////////////

   public Rectangle(int inX, inY, inWidth, inHeight) {

       x = inX;

       y = inY;

       width = inWidth;

       height = inHeight;

   }

   ///////////////////////////////////////////////////////////

   public int getX() {

       return x;

   }

   public int getY() {

       return y;

   }

   

   public int getWidth() {

       return width;

   }

   public int getHeight() {

       return height;

   }

   ///////////////////////////////////////////////////////////

   public int getArea() {

       return width * height;

   }

   public bool isSquare() {

       if (width == height) {

           return true;

       }

       else

           return false;

   }

   ///////////////////////////////////////////////////////////

   public String toString() {

       return "Rectangle located at (" + x + "," + y + ")" + "with dimensions " + width + "x" + height + "and " + getArea() + "is the area.";

   }

}

8 0
3 years ago
In the classroom settting,listeners can best help reduce speaker presentation anxiety by______
Anuta_ua [19.1K]

speaker ?

notify me if wrong i must know.

3 0
3 years ago
Other questions:
  • Choose the appropriate of an image that supports the text. You should also make sure that the image is
    12·2 answers
  • ____ is a real-time Internet communications service that notifies users when one or more people are online and then allows them
    10·1 answer
  • Which might be included in both your speaking outline and your preparation outline? A. Detailed descriptions of each main point
    8·1 answer
  • Most professional coding standards use _____ for class names. (Points : 2) underscores along with all upper case words
    15·1 answer
  • You want to save twenty of your vacation pictures on your computer. Which is the best place to save them?
    6·2 answers
  • What can a Word user do with the Customize Ribbon dialog box? Check all that apply.
    7·1 answer
  • What is a non-example for job application???
    11·1 answer
  • Match the elements used in web searches to their functions.
    12·1 answer
  • Sự ra đời của thương mại điện tử có tác động như thế nào đến việc quảng cáo và Marketing sản phẩm
    11·2 answers
  • Sample program for Do While loop<br><br> Qbasic
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!