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
Svetllana [295]
3 years ago
8

(Java) In the ChiliToGo program in Exercise 12, the costs to produce an adult meal and a child’s meal are $4.35 and $3.10, respe

ctively. Adult meals are sold for $7 and children's meals are sold for $4. Modify the ChiliToGo program to display the total profit for each type of meal as well as the grand total profit.
import java.util.Scanner;
class ChiliToGoProfit
{
public static void main(String[] args) {
// Modify the code below
final double ADULT_PRICE = 7;
final double CHILD_PRICE = 4;
int adultMeals;
int childMeals;
double totalAdult, totalChild, grandTotal;
Scanner input = new Scanner(System.in);
System.out.print("Enter number of adult meals ordered >> ");
adultMeals = input.nextInt();
System.out.print("Enter number of child meals ordered >> ");
childMeals = input.nextInt();
totalAdult = adultMeals * ADULT_PRICE;
totalChild = childMeals * CHILD_PRICE;
grandTotal = totalAdult + totalChild;
System.out.println(adultMeals + " adult meals were ordered at " + ADULT_PRICE + " each.");
System.out.println(" Total is " + totalAdult);
System.out.println(childMeals + " child meals were ordered at " + CHILD_PRICE + " each.");
System.out.println(" Total is " + totalChild);
System.out.println("Grand total for all meals is " + grandTotal);​
Computers and Technology
1 answer:
vichka [17]3 years ago
5 0

Answer: No estoy segura de cuál es la respuesta

Explanation:

You might be interested in
A ____ is an e-mail attack in which the attacker routes large quantities of e-mail to the target system hoping to overwhelm the
GarryVolchara [31]

Answer:

Mail bomb is the correct answer.

Explanation:

In the following statement, A mail bomb is the type of attack on e-mail of the particular person by which the attacker transfers large quantities of e-mail to the target computer in the expectation of flooding the target with so much meaningless e-mail that legitimate e-mail is not accessible. So, that's why the following answer is correct.

3 0
3 years ago
Write a C function that takes an STL vector of int values and determines if all the numbers are different from each other (that
eduard

Answer:

Here is the function:

#include <iostream>  //to use input output functions

#include <vector>  // to use vector (sequence containers)

#include <algorithm>   //use for sequence operations

#include<iterator>  //to move through the elements of sequence or vector

using namespace std;  //to identify objects cin cout

 void DistinctNumbers(std::vector<int> values) { /*function that takes  an STL vector of int values and determines if all the numbers are different from each other */

     sort(values.begin(), values.end());  //sorts the vector elements from start to end

     bool isDistinct = std::adjacent_find(values.begin(), values.end()) == values.end();  //checks for occurrence of two consecutive elements in vector

if(isDistinct==true)  // if all numbers are different from each other

{cout<<"Numbers are distinct";}

else  //if numbers are duplicate or same

{cout<<"Numbers are not distinct";}   }  

int main(){      //start of main function

std::vector<int> v = {1,2,3,4,5};  // vector of int values

DistinctNumbers(v); }  //function call to passing the vector v to check if its elements are distinct

Explanation:

The program that takes an STL vector of int values and the function DistinctNumbers determines if all the numbers are different from each other. It first sorts the contents of the vector in ascending order using sort() method. Then it used the method adjacent_find() to searches the range means from the start to the end of the vector elements, for first occurrence of two consecutive elements that match, and returns an iterator to the first of these two elements, or last if no such pair is found. The result is assigned to a bool type variable isDistinct. It then checks if all the numbers are different and no two adjacent numbers are same. If all the numbers are distinct then this bool variable evaluates to true otherwise false. If the value of isDistinct is true then the message :Numbers are distinct is displayed on screen otherwise message: Numbers are not distinct is displayed in output screen.

7 0
3 years ago
Which of the following Wi-Fi chalking method refers to drawing symbols in public places to advertise open Wi-Fi networks?
dezoksy [38]

Answer War Chalking

Explanation: War chalking is the technique for presenting the WiFi network publicly. This signifies about the WiFi is present but not describes the manner of it , that is whether it is open connection or closed connection.

It can be used by the people in general as well as hackers . Hackers usually tend to attack and hack its security that is present.Hackers then use the WiFi network  is then used for their own work after being hacked.

3 0
3 years ago
Read 2 more answers
What is the function of control unit? in computer. <br>​
ycow [4]

regulates and integrates the operations of the computer. It selects and retrieves instructions from the main memory in proper sequence and interprets them

8 0
3 years ago
Which is the most recent version of microsoft windows?
nignag [31]

Answer:

Windows 11, version 21H2.

Explanation:

this is the latest version as of October 2021.

I hope I helped you!

4 0
2 years ago
Other questions:
  • A _________ is a series of commands and instructions that you group together as a single command to accomplish a task automatica
    15·1 answer
  • What tips or techniques should you keep in mind when shooting photographs on a rainy day?
    6·1 answer
  • Ports on the motherboard can be disabled or enabled in ____ setup. RAM Firmware Northbridge BIOS
    8·1 answer
  • Design a class that has an array of floating-point numbers. The constructor should accept an integer argument and dynamically al
    7·1 answer
  • This assignment requires you to write a program to analyze a web page HTML file. Your program will read one character at a time
    13·1 answer
  • here are pros and cons for doing temp work. Please select the best answer from the choices provided T F
    9·2 answers
  • Assuming dataFile is an ofstream object associated with a disk file named payroll.dat, which of the following statements would w
    9·1 answer
  • Stroke weight - ____ of the line around a shape or size of the point
    8·1 answer
  • What is the difference between Remote Assistance and Remote Desktop?
    5·1 answer
  • If a user wants to change one small section of the formatting of a document and leave the rest the same, which
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!