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
Nikolay [14]
3 years ago
11

(WILL GIVE BRAINLIEST AND ANYTHING ELSE PLEASE HELP ME PLEASE!!!!!!!)

Computers and Technology
2 answers:
lara [203]3 years ago
7 0

Answer:

Actual program code, Errors he found.

Explanation:

Your other two options are not important information that pertain to the code.

svetoff [14.1K]3 years ago
3 0
Errors he found in the code
You might be interested in
How can the Internet help our country to be a leader in technology?
BigorU [14]

Answer:

it can help in the aspect of making technologies to be fastly operated with fast internet connection there by it top among all other countries

4 0
3 years ago
How to set up a simple peer-to-peer network using a star topology?
kkurt [141]

Answer:

The description including its scenario is listed throughout the explanation section below.

Explanation:

Star topology seems to be a LAN system under which all points are connected to a single cable link location, such as with a switch as well as a hub. Put it another way, Star topology is among the most commonly used network configurations.

Throughout this configuration or setup:

  • Each common network setups network unit, such as a firewall, switch, as well as computer.
  • The main network computer serves as either a server as well as the peripheral system serves as just a client.
7 0
3 years ago
Does excel have more than 400 functions
castortr0y [4]
Yes excel has more than 400 functions
7 0
3 years ago
A shipping company uses the following function to calculate the cost in dollars of shipping based on the weight of the package (
Gwar [14]

Answer:

I am writing the code in JAVA and C++. Let me know if you want the code in some other programming language. Both the programs works the same but the only difference is that i have used logical operator AND (&&) with C++ code to check each condition.

JAVA code:

import java.util.Scanner;    // to take input from the user

public class ShippingCost {  // ShippingCost class

public static void main(String[] args) {   // main method entry to the program

Scanner input = new Scanner(System.in);  //allows to take input from user

System.out.print("please enter the weight of the package: "); /*prompts the user to enter the weight of package.*/

double weight = input.nextDouble();  /*reads and stores the input values(weight) entered by the user*/

       double cost=0;  //holds the value of cost

 if (weight<=0)  /* checks if the user enters weight value less than or equals to 0 */

 { System.out.println("invalid input."); //prints invalid input

     System.exit(0); //exits the program

 }

    else if (weight > 0 && weight <= 1)  /*if weight is greater than 0 and less than or equal to 1*/

   cost = 3.5;  /*if the above condition is true then it stores the value 3.5 in cost variable */

 else if (weight <= 3)  // if value of weight is less than or equal to 3

   cost = 5.5;  /*if the above condition is true then it stores the value 5.5 in cost variable */

 else if (weight <= 10)  // if value of weight is less than or equal to 10

   cost = 8.5;  /*if the above condition is true then it stores the value 8.5 in cost variable */

 else if (weight <= 20)  // if value of weight is less than or equal to 20

   cost = 10.5;/*if the above condition is true then it stores the value 10.5 in cost variable */

 else  // if the value of weight is greater than 20

 {  System.out.println("The package cannot be shipped");

// displays package cannot be shipped

      System.exit(0);  //exits the program if weight>20}

 System.out.println("The shipping cost is: $" + cost);     /*prints the value stored in the cost from any of the above conditions */

} }

C++ Code

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

using namespace std;

int main() // start of main() function body

{ double weight; //stores weight value

   double cost= 0; //stores cost value

cout << "please enter the weight of the package:" << endl;

//prompts user to enter the weight

cin >> weight;    

//reads the value of weight entered by the user

  if (weight<=0) //if value of weight entered by user is less than or equal to 0

 { cout<<"invalid input."; //displays invalid input

     exit(0); //exits the program

 }

/*the below else if conditions are checked, if any one of them is true then the cost displayed in the output will be the which is assigned to cost variable of that specific if condition's body which evaluates to true. */

    else if (weight > 0 && weight <= 1)

   cost = 3.5;

 else if (weight > 1 && weight <=3)

   cost = 5.5;

 else if (weight > 3 && weight <= 10)

   cost = 8.5;

 else if (weight> 10 && weight <= 20)

   cost = 10.5;

 else //if weight>20

//displays the message below and exits the program

 {  cout<<"The package can not be shipped";

      exit(0); }

 cout<<"The shipping cost is: $"<<cost;  /*displays the value stored in cost variable of that else-if condition which evaluates to true */

}

Explanation:

Everything is well explained in the comments above. I will summarize it all.

The program takes the input weight from the user and checks the value of weight.

If and else-if conditions are used to check the value of weight.

if the value of weight is less than 0 or equal to 0 then invalid input is displayed.

Else the weight value is checked for the given ranges. && operator is used in each else if statement which is used to specify the range of the weight values the input weight should be in order to display the shipping cost.

For example take this statement: else if (weight > 0 && weight <= 1)

This statement checks the value entered by the user that if it lies in the range mentioned in this statement which is that the weight value should be greater than 0 AND less than or equal to 1. The value cannot lie above or below the given range in order for this condition to be true so && operator is used here.

If the weight entered by user exceeds 20 then the message is displayed:The package can not be shipped and the program exits. In JAVA System.exit(0) and in c++ exit(0) function is used to exit the program.

The output of both the programs is as following:

please enter the weight of the package: 3

The shipping cost is: $ 5.5

8 0
3 years ago
If (accountBalance &lt; 1000.00):
andreyandreev [35.5K]

Answer:

See explanation

Explanation:

Given

The code segment

Required

The output

The code segment is incomplete, as the value of accountBalance is not given.

However, I will explain the given segment using few illustrations.

The following will be executed if accountBalance is less than 1000.00

<em>if (accountBalance < 1000.00): </em>

<em>    print(“SAVINGS3”)</em>

Take for instance:

accountBalance = 500.0; "SAVINGS3" will be printed

The following will be executed if accountBalance is less than 2000.00 but more than or equal to 1000.00

<em>elif (accountBalance < 2000.00): </em>

<em>    print(“SAVINGS2”)  </em>

Take for instance:

accountBalance = 1500.0; "SAVINGS2" will be printed

The following will be executed if accountBalance is less than 3000.00 but more than or equal to 2000.00

<em>elif (accountBalance < 3000.00): </em>

<em>     print(“SAVINGS1”) </em>

Take for instance:

accountBalance = 2500.0; "SAVINGS3" will be printed

Lastly, if accountBalance is 3000.00 or greater, the following will be executed

<em>else: </em>

<em>    print(“SAVINGS”)</em>

Take for instance:

accountBalance = 3500.0; "SAVINGS" will be printed

7 0
3 years ago
Other questions:
  • Members of which generation were born after the turn of the millennium?
    11·1 answer
  • Have main create two objects: setA and setB.Input the values into setA (end with a 0 or negative) and input the values into setB
    12·1 answer
  • hich of the following is a disadvantage of online surveys? They result in high response bias They lead to higher cost per comple
    14·1 answer
  • ___ is the amount of data that a storage device can move from the storage medium to the computer per second.
    11·1 answer
  • List 10 programs or applications on your computer other than any Microsoft office programs
    11·1 answer
  • List two advantages and two disadvantages of Satellite Based<br> Augmentation Systems
    8·1 answer
  • C++
    11·2 answers
  • Write an algorithm that receives a number from the user (you can store the number in a variable called N). Then the algorithm sh
    8·1 answer
  • Help me plz and thank .......................................
    6·2 answers
  • Write an algorithm that describes the second part of the process of making change (counting out the coins and bills).
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!