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
galben [10]
3 years ago
12

Write a program that asks for the weight of a package and the distance it is to be shipped. This information should be passed to

a calculateCharge function that computes and returns the shipping charge to be displayed . The main function should loop to handle multiple packages until a weight of 0 is entered.
Computers and Technology
1 answer:
larisa [96]3 years ago
7 0

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

   const int WEIGHT_MIN   =    0,

             WEIGHT_MAX   =   20,

             DISTANCE_MIN =   10,

             DISTANCE_MAX = 3000;

   float package_weight,

         distance,

         total_charges;

   cout << "\nWhat is the weight (kg) of the package? ";

   cin >> package_weight;

   if (package_weight <= WEIGHT_MIN ||

       package_weight > WEIGHT_MAX)

   {

       cout << "\nWe're sorry, package weight must be\n"

            << " more than 0kg and less than 20kg.\n"

            << "Rerun the program and try again.\n"

            << endl;

   }

   else

   {

       cout << "\nDistance? ";

       cin >> distance;

       if (distance < DISTANCE_MIN ||

           distance > DISTANCE_MAX)

       {

           cout << "\nWe're sorry, the distance must be\n"       << "within 10 and 3000 miles.\n"

                << "Rerun the program and try again.\n"

                << endl;

       }

       else

       {

            if (package_weight <= 2)

               total_charges = (distance / 500) * 1.10;

           else if (package_weight > 2 &&

                   package_weight <= 6)

               total_charges = (distance / 500) * 2.20;

           else if (package_weight > 6 &&

                   package_weight <= 10)

               total_charges = (distance / 500) * 3.70;

           else if (package_weight > 10 &&

                   package_weight <= 20)

               total_charges = (distance / 500) * 4.80;

           cout << setprecision(2) << fixed

               << "Total charges are $"

               << total_charges

               << "\nFor a distance of "

               << distance

               << " miles\nand a total weight of "

               << package_weight

               << "kg.\n"

               << endl;

       }

   }

Explanation:

You might be interested in
Write a report on the recent online tuition
ale4655 [162]

Answer:

dgvhgfh

Explanation:

fghdfgh

8 0
3 years ago
A group of students take hundreds of digital photos for a science project about weather patterns. Each photo file contains data
lesya [120]

Analyzing the metadata would be more appropriate than analyzing the data when: determining the likelihood that the photo was taken at a particular public event.

<h3>What is a data?</h3>

A data can be defined as a representation of instructions or information in a formalized manner, especially as a series of binary digits (bits).

<h3>What is a metadata?</h3>

A metadata can be defined as the data that provides information about one or more aspects of a given data, so as to provide a structured reference that helps to sort and identify all of its attributes such as:

  • Author
  • Date created
  • Date modified
  • File type
  • File size

In this scenario, analyzing the metadata would be more appropriate than analyzing the data when determining the likelihood that the photo was taken or created at a particular public event.

Read more on data here: brainly.com/question/25558534

6 0
2 years ago
Zeke used primarily Web sources for his informative speech about gun control. However, his over-reliance on the website sponsore
Andreas93 [3]

Answer:

a. Objectivity

Explanation:

Zeke ignored objectivity as a criteria for evaluating Web sources.

7 0
2 years ago
Defination of health in multimedia.​
Vinvika [58]

Answer:

Explanation:Nowadays multimedia is characterized by a very complex nature due to the combination of different type of media, data sources, formats and resolutions, etc. Moreover, the performance is an important factor because of the sheer scale of the data to process. Therefore, the area of high-performance and scalable multimedia system gets more important. One of most important, complex and rapidly growing part of multimedia processing is the medical field. In most of the hospitals the potential of the large amount of collected multimedia data is ignored. This is very often because of the difficulties that processing such amount of data implies and lacking of efficient and simple-to-use analysis system. On the other hand, medical experts get more used to interact with multimedia content because of their daily live interaction and they want to use it also in their work. Most of the time this is a problem and the most common multimedia problems lay unsolved in this area. In this talk this problem is put into the spotlight and a multimedia system is presented that tackles automatic analysis of the gastrointestinal tract as a part of this problem. The focus lies on the presentation and evaluation of multimedia systems capabilities in the medical field. Therefore a novel system, that utilizes the benefits of heterogeneous architectures and can be used to automatically analyse high definition colonoscopies and large amount of capsular endoscopy devices are presented as a use case. Furhter it will be shown, that the improvement of multimedia systems performance via GPU-based processing which can help to reach real-time, live multimedia stream processing and low resource consumption which is important for the medical field and can help to save lives.

8 0
3 years ago
A window frame will expand to fill the entire desktop when you
natima [27]
A. Sometimes it is marked by outwards pointing arrows (<= =>) with the reverse (collapsing so as to not take up the whole screen) being in the same spot, marked by inwards arrows (=> <=)
8 0
3 years ago
Other questions:
  • Data mining is ______? a process of finding meaningful patterns in data to improve decisions a strategy for locating security so
    7·1 answer
  • The largest country in South America
    7·1 answer
  • Urgent help<br> Write a program that prints ‘Hello World’ to the screen
    8·1 answer
  • Which Ribbon contains the paragraph attributes?<br><br> Home<br> Insert<br> Review<br> View
    8·2 answers
  • Which of the following is a job description for a person with a degree in information technology
    15·1 answer
  • Assembly (Procedure and Conditional Processing). For the following program, what are outputs for register EAX, EBX, ECX, and EDX
    11·1 answer
  • In black and white,<br><br> we must be more conscious of image
    11·1 answer
  • What goals do you set for yourself while studying?
    9·2 answers
  • Create a multimedia project that contains the text element and all the contents that you have studied about that element
    13·1 answer
  • A pseudo code that asks the user for their forename and their surname , and then outputs both, separated by a space to the user​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!