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
ololo11 [35]
3 years ago
12

The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.

Computers and Technology
1 answer:
Sonbull [250]3 years ago
6 0

Answer:

The following alterations are done to the program

1. Replace <em>/* Your solution goes here */ </em>with

<em>const int CENTS_PER_POUND = 25;</em>

<em>cout<<"Ship Weight Pounds: "; </em>

<em>cin>>shipWeightPounds; </em>

<em />

2. Include

<em>shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;</em>

after

<em>cout << ", Cents per lb: " << CENTS_PER_POUND;</em>

Explanation:

<em>See attachment for complete program as it should be ordered</em>

<em></em>

This line declares CENTS_PER_POUND as a constant integer and it also initializes the variable to 25

<em>const int CENTS_PER_POUND = 25;</em>

This prompts the user for the weight of the shipping items (in pounds)

<em>cout<<"Ship Weight Pounds: "; </em>

<em />

This gets user input for  the weight of the shipping item

<em>cin>>shipWeightPounds; </em>

<em />

<em>.............................</em>

<em>........</em>

<em>...</em>

This calculates the cost of shipping the item

<em>shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;</em>

Download cpp
You might be interested in
A ________ allows users to add, remove, or edit its content.
Amanda [17]
Wiki is the correct answer
4 0
3 years ago
Read 2 more answers
In JAVA please:
blagie [28]

Answer:

import java.util.Scanner;

public class ArraysKeyValue {

public static void main (String [] args) {

final int SIZE_LIST = 4;

int[] keysList = new int[SIZE_LIST];

int[] itemsList = new int[SIZE_LIST];

int i;

keysList[0] = 13;

keysList[1] = 47;

keysList[2] = 71;

keysList[3] = 59;

itemsList[0] = 12;

itemsList[1] = 36;

itemsList[2] = 72;

itemsList[3] = 54;  

/* Your solution goes here */

for ( i = 0; i < SIZE_LIST; i++){

 if (keysList[i]>50){

  System.out.println(itemsList[i] + " ");  }  }

System.out.println("");

}

}

Explanation:

I will explain the whole program flow.

  • There are two arrays here
  • keysList and itemsList
  • The first list (keysList) contains the following elements:

13 element at first position of the array (0th index)

47 element at second  position of the array (1st index)

71 element at third position of the array (2nd index)

59 element at fourth position of the array (3rd index)

  • The other list (itemsList) contains the following elements:

12 element at first position of the array (0th index)

36 element at second  position of the array (1st index)

72 element at third position of the array (2nd index)

54 element at fourth position of the array (3rd index)

  • The size of the array elements is fixed which is 4 and is stored in the variable SIZE_LIST.
  • Then the loop starts. The loop contains a variable i which is initialized to 0. First it checks if the value of i is less than the size of the list. It is true as SIZE_LIST=4 and i=0.
  • So the program control enters the body of the loop.
  • In first iteration, IF condition checks if the i-th element of the keysList is greater than 50. As i=0 So the element at 0th index of the keysList is 13 which is not greater than 50 so the body of IF statement will not execute as the condition evaluates to false. The value of i increments by 1 so now i becomes 1.
  • In next iteration loop again checks if the value of i is less than the size of the list which is true again so the body of the loop executes.
  • IF condition checks if the i-th element of the keysList is greater than 50. As i=1 So the element at 1st index of the keysList is 47 which is not greater than 50 so the body of IF statement will not execute as the condition evaluates to false. The value of i is incremented by 1 so now i becomes 2.
  • In next iteration loop again checks if the value of i is less than the size of the list which is true again as i= 2 which is less than SIZE_LIST so the body of the loop executes.
  • IF condition checks if the i-th element of the keysList is greater than 50. As i=2 So the element at 2nd index of the keysList is 71 which is greater than 50 so the body of IF statement is executed as the condition evaluates to true. So in the body of the IF statement there is a print statement which prints the i-th element of the itemsList. As i = 2 so the value at the index 2 of the itemsList is displayed in the output which is 72. Next value of i is incremented by 1 so now i becomes 3.
  • In next iteration loop again checks if the value of i is less than the size of the list which is true again as i= 3 which is less than SIZE_LIST so the body of the loop executes.
  • IF condition checks if the i-th element of the keysList is greater than 50. As i=3 So the element at 3rd index of the keysList is 59 which is greater than 50 so the body of IF statement is executed as the condition evaluates to true. So in the body of the IF statement there is a print statement which prints the i-th element of the itemsList. As i = 3 so the value at the index 3 of the itemsList is displayed in the output which is 54. Next value of i is incremented by 1 so now i becomes 4.
  • In next iteration loop again checks if the value of i is less than the size of the list which is now false as i=4 which is equal to the SIZE_LIST= 4. So the loop breaks.
  • So the output of the above program is:

72

54

5 0
3 years ago
Several of the items below indicate the steps required to move a slide to a different location in a presentation. Select those s
NikAS [45]
The answer should be
2
4
3
5
1
6
8 0
3 years ago
Read 2 more answers
A voltage measurement error is caused by the integration time window of a digital volt-meter. This is a _____________error.
gladu [14]

Answer: Systematic error

Explanation:

  The systematic error is the type of error which is basically caused due to the integration time of the digital volt meter in the voltage error measurement.

It is one of the type of error that occur during the measurement of the voltage due to mismatch start channel. It basically result into the difference between the fall and rise in channel and the difference in the propagation delay.

The systematic error is basically introduce by interconnect different types of cable and setting the triggering level in the system. This type of error are constant in the given measurement configuration process.

4 0
3 years ago
porfavor no es una pregunta dificil, nisiquiera es de una tarea, hace poco mi computador windows 10 no recibia el sonido de mis
amid [387]

Answer:

he intentado encender la computadora mono

Explanation:

6 0
3 years ago
Other questions:
  • Does a soda vending machine Give reciepts?<br><br>need for computer science hw
    7·2 answers
  • Using the scenario below, answer the following questions:
    11·1 answer
  • How do you determine latitude using an astrolabe?
    11·1 answer
  • DeShawn uses Google Ads. He wants to enable website call conversion tracking so he can see how his current ad campaign is drivin
    12·1 answer
  • What type of account should you use fro signing in to your windows 8 computer if you want to synchronize your settings on other
    6·1 answer
  • Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in t
    12·1 answer
  • The three basic processes of memory are ______.
    10·1 answer
  • Which statement below is true about how the functions of the digestive and circulatory system are connected.
    7·1 answer
  • A computer technician is responding to a call about a printer that is causing streaks to appear on every printout. Which of the
    5·1 answer
  • Lets say if my computer shut down every 10 minutes. What can you do to solve the problem. Hint: Use these word in you answer: ha
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!