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
marissa [1.9K]
4 years ago
7

//Display message Module main () // Declare variables Declare real weight Declare real shipping //Get package weight Call getWei

ght (weight) //Calculate the Shipping Charge Call setShipping (weight, shipping) //Display Shipping Charge Call showShipping (shipping) End Module //Display program Module showing () Display "Calculate Fast Freight Shipping Rates Here." End Module //Receive Input From User Module getWeight (Real Ref inputWeight) Display "Enter package weight:", weight Input Weight End Module //Set Shipping Rates Module setShipping (Real weight, Ref calShipping) If weight > 10 Then Set calcShipping = 3.80 Else If weight > 6 Then Set calcShipping = 3.70 Else If weight > 2 Then Set calcShipping = 2.20 Else Set calcShipping = 1.10 End If End Module //Display shipping charges Module showShipping (Real shipping) Display "Shipping charge: $", shipping End Module
Computers and Technology
1 answer:
galina1969 [7]4 years ago
6 0

Answer:

This program is created to Calculate Fast Freight Shipping Rates. It  prompts user to enter the weight of the package, calculates the shipping charges of the package and display the charges on the screen.

Explanation:

#include<iostream>

using namespace std;

// declaring functions

void Display();

float getWeight ();

float setShipping (float);

void showShipping (float);

main()  // main function

{

float Weight, Shipping;

Display();

Weight=getWeight();                     //function call

Shipping=setShipping(Weight);   //function call

showShipping(Shipping);             //function call

 

}

void Display()     // function to display message

{

cout<<"Calculate Fast Freight Shipping Rates Here:"<<endl;

}

 

float getWeight ()    // function to get weight

{

float Weight;

cout<< "Enter package weight:";

cin>> Weight;

return Weight;

}

float setShipping (float Weight)    //funtion to calculate shipping

{

float calShipping;

if (Weight > 10)

calShipping=3.80;

else if (Weight > 6)

calShipping= 3.70;

else if (Weight > 2)

calShipping= 2.2;

else

calShipping= 1.10;

return calShipping;

}

void showShipping (float Shipping)    // funtion to disps chargepping shilay

{

cout<<"Shipping Charges: $" << Shipping;

}

You might be interested in
Determine whether or not the following pairs of predicates are unifiable. If they are, give the most-general unifier and show th
Evgen [1.6K]

Answer:

a) P(B,A,B), P(x,y,z)

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }.

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q.

c. Older(Father(y),y), Older(Father(x),John)

Thus , mgu ={ y/x , x/John }.

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B.

e) P(f(x), x, g(x)), P(f(y), A, z)    

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

Explanation:  

Unification: Any substitution that makes two expressions equal is called a unifier.  

a) P(B,A,B), P(x,y,z)  

Use { x/B}  

=> P(B,A,B) , P(B,y,z)  

Now use {y/A}  

=> P(B,A,B) , P(B,A,z)  

Now, use {z/B}  

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }  

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q  

c. Older(Father(y),y), Older(Father(x),John)  

Use {y/x}  

=> Older(Father(x),x), Older(Father(x),John)  

Now use { x/John }  

=> Older(Father(John), John), Older(Father(John), John)  

Thus , mgu ={ y/x , x/John }  

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))  

Use { y/x }  

=> Q(G(x,z),G(z,x)), Q(G(x,x),G(A,B))

Use {z/x}  

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B  

e) P(f(x), x, g(x)), P(f(y), A, z)  

Use {x/y}  

=> P(f(y), y, g(y)), P(f(y), A, z)  

Now use {z/g(y)}  

P(f(y), y, g(y)), P(f(y), A, g(y))  

Now use {y/A}  

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

7 0
3 years ago
Online companies typically have a(n) _________ on their websites that clearly states what information is collected from users an
Goshia [24]

Answer:

Privacy Policy

Explanation:

A privacy policy is a written a document which  tells visitors to company's website what information will be collected and what the information will be used for. Simply put, it is a short statement of what you are doing to observe visitors to your website through use of cookies and other third parties like google ads.

5 0
4 years ago
WHICH IS THE BEST EXAMPLA OF AI IN EDUCATION?
amm1812
An education is when you go to school and learn about certain topics and litature
7 0
3 years ago
Which of the following comments is an example of the sandwich technique of giving feedback?
Marta_Voda [28]
<span>Think about a basic sandwich, you have a slice of bread, some filling, and another slice of bread. The sandwich technique of feedback is exactly the same way, a slice of bread (complement the person), the filling (what you'd like to have improve), and finally another slice of bread (another complement). So with that in mind, let's look at the available options. 1. I really appreciate your attention to detail when stocking shelves; however, you need to be a little bit faster when doing the stocking. I also like how nice the shelves look when you are done working on them. * This looks good, you have a complement about the attention to detail, afterwards you mention that you'd like the person to do their job faster, and you follow up with a complement about how nice the final result works. Bread, filling, bread. This looks like the correct answer. 2. I really appreciate your attention to detail when stocking shelves; however, you need to speed it up. You need to be a little bit faster when stocking shelves. * This starts off well with a complement about attention to detail. It then starts with some filling about the job being needed to be done faster. But if falls down with a second serving of the same filling. So you have bread, filling, filling. Not a sandwich, so this is incorrect. 3. I do appreciate how nice the shelves look when you are done working on them, though. You're really not too fast when you are doing the stocking. * Another nice start with a complement. And you sort of have some filling (not sure if you're merely observing the lack of speed, or recommending more speed). But you still lack the 2nd piece of bread. So this isn't correct either. 4. I really appreciate your attention to detail when stocking shelves, but it would be great if you could maybe speed it up. * Once again, you correctly start off with a complement. And you follow up with the filling (what you want done better), but you're lacking the 2nd piece of bread. Not the right choice. So of the 4 available choices, the best choice is the 1st option.</span>
5 0
4 years ago
Which interface element of a presentation program will enable Ben to see the slide number, design template, and the page style o
kicyunya [14]

B menu bar is correct.

7 0
3 years ago
Read 2 more answers
Other questions:
  • As yall know its spoopy season. This means spoopy music! I am having a live stream on the Spoon app under the username teendrago
    11·1 answer
  • Weber believed that there is an inevitable destructive quality to which one of the four types of action?
    8·1 answer
  • The file extensions .webm, .m4v, and .ogv are used for:
    15·1 answer
  • Need help ASPA!!!!!!!!!
    9·2 answers
  • Which of these are examples of metadata for an audio file of a song recording?
    10·2 answers
  • Design the logic for a program that allows a usher to continuously enter numbers until the usher enters 0. Display the sum of th
    9·1 answer
  • What does this function do in the code?
    5·2 answers
  • Attach 2 screen shots demonstrating an understanding of file management tools, such as keyboard shortcuts, copy, paste, delete,
    8·1 answer
  • All _______ that store more than one piece of data ​
    12·1 answer
  • Resource _____ let you view, manage, and automate tasks on multiple aws resources at a time.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!