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
Complete the sentence to identify advantages of top-down programming design. Choose all that apply.
yanalaym [24]

Answer:The original choice to write apply_fg so that it accepts function arguments is a good one, because it increases interoperability. When the callable arguments to apply_fg use a single protocol, we can easily exchange them: #include <functional> float log2(float); int a = apply_fg(5.Of, int b = apply_fg(3.14f,

Explanation:

3 0
3 years ago
Read 2 more answers
True/False: If a function is legally prototyped to return an integer value, it can return a structure member that is an integer
sdas [7]
#1) If a function is legally prototyped to return an integer value, it can return a structure member that is an integer data type.
Answer: True. Any method that is not declared void must contain a return statement with a corresponding return value. The data type of the return value must match the method's declared return type; you can't return an integer value from a method declared to return a boolean.
5 0
3 years ago
The variable used in a loop to control the number of times it is executed is called a _______.
tia_tia [17]

Answer:

the variable used in a loop to control the number of timer is executed is called a interaction.

Explanation:

a particular way in which matter, fields, and atomic and subatomic particles affect one another

6 0
3 years ago
6 The part of the computer that contains the brain or central processing unit is also known as the ?
Olin [163]
Answer:  "CPU" .
________________________________
4 0
3 years ago
A digital certificate system: Group of answer choices uses digital signatures to validate a user's identity. is used primarily b
kompoz [17]

Answer:

uses third party CAs to validate a user's identity

Explanation:

The Digital Certificate is the only means that technically and legally guarantees the identity of a person on the Internet. This is an essential requirement for institutions to offer secure services over the Internet. Further:

The digital certificate allows the electronic signature of documents The recipient of a signed document can be sure that it is the original and has not been tampered with and the author of the electronic signature cannot deny the authorship of this signature.

The digital certificate allows encryption of communications. Only the recipient of the information will be able to access its content.

4 0
3 years ago
Other questions:
  • Which of the following statements is true of a database? a. It is a collection of unstructured data. b. It is accessed primarily
    14·1 answer
  • Please help
    5·1 answer
  • Do you believe that OOP should be phased out and we should start working on some alternative
    6·1 answer
  • What file may contain data written to it in case of an unexpected error or program shut-down?
    5·1 answer
  • Which statement is used to create a file object that will append data to an existing file? BufferedWriter salesdata =
    7·2 answers
  • If Chris has a car liability insurance, what damage would he be covered for
    10·1 answer
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp
    12·1 answer
  • An instruction book or program that takes users through a prescribed series of steps to learn how to use a program is called (a)
    10·1 answer
  • You can use tables for layout work. However, in XHTML, each form control should have its own ______ element
    12·1 answer
  • The most serious security threat to Bluetooth-enabled devices is ____, which occurs when a hacker gains access to the device and
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!