ITIS 1214 Assignment 1 Part 1

ITIS 1214 Assignment 1 Part 1 - cost = 3 else...

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 >= 5 && weight < 10) { cost = (weight - 5) * .25 + 3; } else { if (weight >= 10 && weight < 15) { cost = (weight - 10) * .20 + 5.50; } else { if (weight >= 15) { cost = (weight - 15) * .10 + 8.50; } } } } cout << "The weight of your package is " << weight << endl; cout << "The price to ship your package is $" << cost; }...
View Full Document

This note was uploaded on 04/08/2008 for the course ITCS 1214 taught by Professor Lehmann during the Fall '07 term at UNC Charlotte.

Page1 / 2

ITIS 1214 Assignment 1 Part 1 - cost = 3 else...

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