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
An urn contains r red, w white, and b black balls. Which has higher entropy, drawing k ~2 balls from the urn with replacement or
svetlana [45]

Answer:

The case with replacement has higher entropy

Explanation:

The complete question is given:

'Drawing with and without replacement. An urn contains r red,  w white  and b black balls. Which has higher entropy, drawing k ≥ 2 balls from the urn with  replacement or without replacement?'

Solution:

- n drawing is the same irrespective of whether there is replacement or not.

-  X to denotes drawing from an urn with r red balls,  w white balls and b black balls. So, n = b + r +  w.

We have:

                                      p_X(cr) = r / n

                                      p_X(cw) = w / n

                                      p_X(cb) = b / n

- Now, if  Xi is the ith drawing with replacement then Xi are independent and p_Xi (x) = pX(x) for x e ( cr , cb , cw ).

- Now, let  Yi be the ith drawing with replacement where Yi are not independent p_Yi (x) = pX(x) for x ∈ X.

- To see this, note  Y1 =  X and assume it is true for  Yi and consider  Yi+1:

    p_Y(i+1) (cr) = p(Y(i+1),Yi).(cr, cr) + p(Y(i+1),Yi).(cr, cw) + p(Y(i+1),Yi).(cr, cb)

= pY(i+1)|Yi  (cr|cr)*pYi  (cr) +pY(i+1)|Yi  (cr|cw)*pYi (cw) + pY(i+1)|Yi  (cr|cb)*pYi (cb)

= r*( r - 1 )/n*(n-1) + w*r/n*(n-1) + b*r/n*(n-1) = r / n =  p_X(cr)

- This means, using the chain rule and the conditioning theore m:

H(Y1, Y2, . . . , Yn) =  H(Y1) +  H(Y2|Y1) +  H(Y3|Y2, Y1) + ... H(Yn|Yn−1, . . . , Y1)

=< SUM H(Yi) = n*H(X) =  H(X1, X2, . . . , Xn)

- with equality if and only if the  Yi were independent:

                          H(Y1, Y2, . . . , Yn) < H(X1, X2, . . . , Xn)

Answer: The case with replacement has higher entropy

   

4 0
4 years ago
What is the standard half-cell potential for the oxidation of methane under acidic conditions? The reaction for methane is as fo
Yuri [45]

Answer:

The element that is oxidized is carbon.

Its oxidation state increased. It increased from -4 to +4

Explanation:

Oxidation is a process that involves increase in oxidation number.

The oxidation number of carbon in CH4 is -4

C + (1×4) = 0

C + 4 = 0

C = 0 - 4 = -4

The oxidation number of carbon in CO2 is +4

C + (2×-2) = 0

C - 4 = 0

C = 0+4 = 4

Increase in the oxidation number of carbon from -4 to +4 means carbon is oxidized

4 0
3 years ago
In a lab, scientists grew several generations of offspring of a plant using the method shown. What conclusion can you make about
exis [7]
Answer: c) they have low genetic variability among them.


When a plant is grown for several generations of offspring of a plant, then there are some common things which are to be noted which are found similar in the offspring and in the parent of the offspring. The flowers and fruits and the time or season they come in are absolutely the same.
6 0
1 year ago
An automobile has a mass of 1200 kg. What is its kinetic energy, in ki, relative to the road when traveling at a velocity of 50
netineya [11]

Answer:

a)Ek=115759.26J

b)23.15kW

Explanation:

kinetic energy(Ek) is understood as that energy that has a body with mass when it travels with a certain speed, it is calculated by the following equation

Ek=0.5mv^{2}

for the first part

m=1200Kg

V=50km/h=13.89m/s

solving for Ek

Ek=0.5(1200)(13.89)^2

Ek=115759.26J

For the second part of the problem we calculate the kinetic energy, using the same formula, then in order to find the energy change we find the difference between the two, finally divide over time (15s) to find the power.

m=1200kg

V=100km/h=27.78m/s

Ek=0.5(1200)(27.78)^2=462963J\\

taking into account all of the above the following equation is inferred

ΔE=\frac{Ek2-EK1}{T}=\frac{462963-115759.26}{15}  =23146.916W=23.15kW

3 0
3 years ago
In ________ programming, the programming is centered on objects that are created from abstract data types that encapsulate data
Contact [7]

Answer:

<em>Object-oriented</em>

Explanation:

<em>Object Oriented programming</em> <em>(OOP)</em> is a specific way of programming, where the code is organized in units called classes, from which objects are created that are related to each other to achieve the objectives of the applications. Object-oriented programming took over as the dominant programming style in the mid-1980s, largely due to the influence of C ++. Its dominance was consolidated thanks to the rise of graphical user interfaces, for which object-oriented programming is particularly well suited. Its most important characteristics are the following:

  • Encapsulation
  • Polymorphism
  • Abstraction
  • Inheritance

8 0
3 years ago
Other questions:
  • Given a 8-bit ripple carry adder and the following four input scenarios: (i) A4 + 1F, (ii) AB+55, (iii) CA+34, (iv) 6D+29. a) Un
    5·2 answers
  • Small droplets of carbon tetrachloride at 68 °F are formed with a spray nozzle. If the average diameter of the droplets is 200 u
    10·1 answer
  • Communication "works" to the degree that a wide variety of information is completely and thoroughly shared among the parties, an
    13·1 answer
  • When all network cables connect to one central point the network topology is typically referred to as a(n)_______
    6·1 answer
  • For a LED diode that has a= 632 nm, then the A1 is equal to:​
    13·1 answer
  • What is JIT and why would you advocate it to reduce inventory?
    8·1 answer
  • After cutting a PVC pipe you should use a<br> to debure the pipe
    7·1 answer
  • A 1,040 N force is recorded on a hemispherical vane as it redirects a 2.5 cm- blade diameter water jet through a 180 angle. Dete
    11·1 answer
  • A transformer has a 120/208-volt wye secondary. If the current in each of the secondary coils (or windings) is 75 amps, what is
    6·1 answer
  • What is the difference between mnemonic codes and machine codes?​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!