ITIS 1214 Assignment 1 Part 1

ITIS 1214 Assignment 1 Part 1 - { cost = 3; } else { if...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* Program: CostPackage Author: Cory Carman Date: 10/3/07 Purpose: This program will have the user input the weight of a package and calculate the cost of mailing that package. It will print the weight of the package and its cost to send. */ #include <iostream> using namespace std; int main() { float weight; float cost; cout << "Please input the weight of the package you wish to send: " ; cin >> weight; if (weight < 5)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { cost = 3; } else { if (weight &gt;= 5 &amp;&amp; weight &lt; 10) { cost = (weight - 5) * .25 + 3; } else { if (weight &gt;= 10 &amp;&amp; weight &lt; 15) { cost = (weight - 10) * .20 + 5.50; } else { if (weight &gt;= 15) { cost = (weight - 15) * .10 + 8.50; } } } } cout &lt;&lt; &quot;The weight of your package is &quot; &lt;&lt; weight &lt;&lt; endl; cout &lt;&lt; &quot;The price to ship your package is $&quot; &lt;&lt; cost; }...
View Full Document

Page1 / 2

ITIS 1214 Assignment 1 Part 1 - { cost = 3; } else { if...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online