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
3241004551 [841]
3 years ago
14

Global Courier Services will ship your package based on how much it weighs and how far you are sending the package. Packages abo

ve 100 pounds will not be shipped. You need to write a program in C that calculates the shipping charge.
Engineering
1 answer:
denis23 [38]3 years ago
8 0

Answer:

The code will be:

#include <stdio.h>

#include <stdlib.h>

main () {

double weight, shippingCharge, rate, segments;

int distance;

printf("Enter the weight: \n");

scanf("%lf", &weight);

printf("Enter the distance: \n");

scanf("%i", &distance);

if (weight <= 10) {

printf("Rate is $3.00 \n");

rate = 3;

} else {

printf("Rate is $5.00 \n");

rate = 5;

}

if (distance % 500 == 0) {

segments = distance / 500;

} else {

segments = distance / 500 + 1;

}

shippingCharge = rate * segments;

if (distance >1000) {

shippingCharge = shippingCharge + 10;

}

printf("Your shipping charge is $%lf\n", shippingCharge);

system ("pause");

}

You might be interested in
A crude fermenter is set up in a shed in the backyard of a suburban house. Under anaerobic conditions with ammonia as the nitrog
Aleks04 [339]

Answer:

using calculations Heat losses will be 4512 J

5 0
3 years ago
2.4: Add a method called setValue(), and the description of setValue is: public int setValue(long searchKey) In this method, the
Yanka [14]

Answer:

Below is java code that must be used for the given question:

// highArray.java

// demonstrates array class with high-level interface

// to run this program: C>java HighArrayApp

////////////////////////////////////////////////////////////////

class HighArray

  {

  private long[] a;                 // ref to array a

  private int nElems;               // number of data items

  //-----------------------------------------------------------

  public HighArray(int max)         // constructor

     {

     a = new long[max];                 // create the array

     nElems = 0;                        // no items yet

     }

  //-----------------------------------------------------------

  public setValue find(long searchKey)

     {                              // find specified value

     int j;

     for(j=0; j<nElems; j++)            // for each element,

        if(a[j] == searchKey)           // found item?

           break;                       // exit loop before end

     if(j == nElems)                    // gone to end?

        return false;                   // yes, can't find it

     else

        return true;                    // no, found it

     }  // end find()

  //-----------------------------------------------------------

  public void insert(long value)    // put element into array

     {

     a[nElems] = value;             // insert it

     nElems++;                      // increment size

     }

  //-----------------------------------------------------------

  public void display()             // displays array contents

     {

     for(int j=0; j<nElems; j++)       // for each element,

        System.out.print(a[j] + " ");  // display it

     System.out.println("");

     }

  //-----------------------------------------------------------

  }  // end class HighArray

////////////////////////////////////////////////////////////////

class HighArrayApp

  {

  public static void main(String[] args)

     {

     int maxSize = 100;            // array size

     HighArray arr;                // reference to array

     arr = new HighArray(maxSize); // create the array

     arr.insert(77);               // insert 10 items

     arr.insert(99);

     arr.insert(44);

     arr.insert(55);

     arr.insert(22);

     arr.insert(88);

     arr.insert(11);

     arr.insert(00);

     arr.insert(66);

     arr.insert(33);

     arr.display();                // display items

     int searchKey = 35;           // search for item

     if( arr.find(searchKey) )

        System.out.println("Found " + searchKey);

     else

        System.out.println("Can't find " + searchKey);

     }  // end main()

  }  // end class HighArrayApp

Explanation:

6 0
3 years ago
What is the activation energy (Q) for a vacancy formation if 10 moles of a metal have 2.3 X 10^13 vacancies at 425°C?
Yakvenalex [24]

Answer:

Activation\ Energy=2.5\times 10^{-19}\ J

Explanation:

Using the expression shown below as:

N_v=N\times e^{-\frac {Q_v}{k\times T}

Where,

N_v is the number of vacancies

N is the number of defective sites

k is Boltzmann's constant = 1.38\times 10^{-23}\ J/K

{Q_v} is the activation energy

T is the temperature

Given that:

N_v=2.3\times 10^{13}

N = 10 moles

1 mole = 6.023\times 10^{23}

So,

N = 10\times 6.023\times 10^{23}=6.023\times 10^{24}

Temperature = 425°C

The conversion of T( °C) to T(K) is shown below:

T(K) = T( °C) + 273.15  

So,  

T = (425 + 273.15) K = 698.15 K  

T = 698.15 K

Applying the values as:

2.3\times 10^{13}=6.023\times 10^{24}\times e^{-\frac {Q_v}{1.38\times 10^{-23}\times 698.15}

ln[\frac {2.3}{6.023}\times 10^{-11}]=-\frac {Q_v}{1.38\times 10^{-23}\times 698.15}

Q_v=2.5\times 10^{-19}\ J

4 0
3 years ago
3. Briefly explain the conduction mechanism in metals?​
Bingel [31]

Answer:

conduction occurs when a substance is heated

Explanation:

3 0
2 years ago
Determine how much concrete you will need for a slab which is 50 feet by 30 feet wide and 1 foot thick
Levart [38]

Answer:

Amount of concrete need to make slab = 1,500 feet³

Explanation:

Given:

Length of slab = 50 feet

Width of slab = 30 feet

Height of slab = 1 feet

Find:

Amount of concrete need to make slab

Computation;

Amount of concrete need to make slab = Volume of cuboid

Volume of cuboid = (l)(b)(h)

Amount of concrete need to make slab = (50)(30)(1)

Amount of concrete need to make slab = 1,500 feet³

6 0
3 years ago
Other questions:
  • If a torque of M = 300 N⋅m is applied to the flywheel, determine the force that must be developed in the hydraulic cylinder CD t
    13·1 answer
  • Suppose that the president of a small island nation has decided to increase government spending by constructing three beach reso
    11·1 answer
  • 11.A heat engine operates between two reservoirs at 800 and 20°C. One-half of the work output of the heat engine is used to driv
    6·1 answer
  • Calculate the diffusion current density for the following carrier distributions. For electrons, use Dn = 35 cm2/s and for holes,
    6·1 answer
  • First person to tell me what this car is gets 10 points
    10·2 answers
  • If you are in a tornado situation, which of the following actions would put you in danger?
    11·1 answer
  • A coal-fired power plant is burning bituminous coal that has an energy content of 12,000 Btu/lb. The power plant is burning the
    13·1 answer
  • Tony works as a Sorter in a processing factory. Which qualifications does he most likely have?
    10·2 answers
  • If the power to a condensing unit has been turned off for an extended period of time, the _________________________ should be en
    12·1 answer
  • ?Why the efficiency of Class A amplifier is very poor​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!