Feeling like I'm missing something here....

So I have an assignment, I want to believe that the pieces are there, but I'm failing to connect some dots. What exactly am I doing wrong here? I'm newish to C++ so I might not follow along the first time around, for that I apologize. Anyhow, the assignment that I am working is to Create a class called Postage. Provide a function called setWeight to set the weight of a package in pounds. Packages cannot weigh more than 70 pounds. The sendEconomy function returns a price based on the formula: $2.00 plus 40 cents per pound. The sendPriorty function returns a price of $5.00 plus 50 cents per pound. The sendOvernight function returns a price of $18.00 plus $2.00 per pound.

Using the class from the prior question, write a main function that asks for the weight of a package and prints out the postal charges (Economy, Priority, and Overnight).


this is my header file:
#pragma once

#include <iostream>
#include <iomanip>
using namespace std;

class Postage {
public:

void initialize();
int setWeight();
void sendEconomy(int weight, double price, double cost);
void sendPriority(int weight, double price, double cost);
void sendOvernight(int weight, double price, double cost);
void printInfo(void);
double itsPrice;
int weight;
double cost;
double Price;


private:

~Postage();

};


void Postage::initialize()
{



}

inline int Postage::setWeight()
{

do {
cout << "how much does your package weigh?" << endl << "Please enter the weight here: " << endl;
cin >> weight;
if (weight <= 70) {
cout << "you have entered " << weight << endl;

}
else if (weight >= 71 || weight <= 0) {
cout << "We do not ship items that are over 70 pounds. What do you think we are amazon? Try again: ";
cin >> weight;
}
} while (weight >= 70 || weight <= 0);
return weight;
}

void Postage::sendEconomy(int weight, double price, double cost)
{
weight = weight;
price = 2.00 + (weight * .40);
price = cost;
}

void Postage::sendPriority(int weight, double price, double cost)
{
weight = weight;
price = 5.00 + (weight * .50);
price = cost;
}

void Postage::sendOvernight(int weight, double price, double cost)
{
weight = weight;
price = 18.00 + (weight * 2.00);
price = cost;
}

void Postage::printInfo()
{
cout << fixed << setprecision(2) << cost;
cout << "Your total shipping cost is " << "$" << cost << endl;
}



Postage::~Postage()
{
}


And this is my main:

/*
Create a class called Postage. Provide a function called setWeight to set the weight of a package in pounds. Packages cannot weigh more than 70 pounds. The sendEconomy function returns a price based on the formula: $2.00 plus 40 cents per pound. The sendPriorty function returns a price of $5.00 plus 50 cents per pound. The sendOvernight function returns a price of $18.00 plus $2.00 per pound.

Using the class from the prior question, write a main function that asks for the weight of a package and prints out the postal charges (Economy, Priority, and Overnight).
*/


#include <iostream>
#include <iomanip>
#include "Source.h"
using namespace std;








int main() {
int input;
int weight = 0;




cout << "How fast would you like to ship it?" << endl;
cout << "choose 1 to ship standard shipping" << endl;
cout << "choose 2 to ship priority shipping" << endl;
cout << "choose 3 to ship overnight shipping" << endl;
cout << "Please choose a shipping option: " << endl;
cin >> input;
switch (input) {
case 1:

int setWeight();
void initiailize();
void standard();
void printInfo();

void printMessage(void);
system("pause");
break;
case 2:
void initialize();
void priority();
void printInfo();
void printmessage();
system("pause");
break;
case 3:
void initialize();
void overnight();
void printInfo();
void printMessage();
system("pause");
break;
default:
cout << "You choose something I don't understand. We don't tolerate your wasting of time. Go away! " << endl;
break;
}


system("pause");



return 0;
}



When I execute it goes through the switch, hits the system("pause") twice then exits. I'm fairly certain that I am not getting into the function calls and I assume that is because I don't have them set up correctly. Anything helps, I don't need anyone to do the assignment for me, just need some advice on what it is I am missing. Thank you in advance. Also if the question posts in a strange or unorthodox way I also apologize.
Look at this snippet:
1
2
3
4
5
6
case 1:

int setWeight();
void initiailize();
void standard();
void printInfo();


Do you realize that these are function prototypes, not function calls? And note that you have not implemented these functions (they are not your class member functions).

Topic archived. No new replies allowed.