Code for a "vidbox" prototypes not functions, writings and reading from a file?

The assignments has me updating files throughout the program to keep current records. Also while applying discounts and doing some error checking. I am not allowed to utilize functions at this time but I can utilize prototypes (I'm not even sure of the difference). I am having several issues with the program it will not compile at all (I am utilizing VS 2013). The probelms seem to revolve around my use of prototypes, passing information back anfd forth between them, the file writing, reading, opening ect., and my switch statement. At this point there are so many errors I'm a littl overwhelmed and I'm not doen with the program yet. Thank you for any and all help!!

the file dayin00.dat needs to have 2 different numbers on 2 seperate lines the current number of videos in the box and the current amount of $ in the box.

the file current11.dat should have a line written to it every time a transaction is completed, to include the member ID of the person, the number of DVD's taken or returned, the amt of $ that was added, the overall count of DVD's, and the total amount of $ in the vidbox.

dayout99.dat should have the current amount of $ in the machine and the amount of DVD's in the unit but only when "Close down" is chosen from the menu.

// This program is designed to identify if a user is an administrator and display sub menus based on ID#.
// This program also tracks and identifies how many movies a user is checking out or in and displays the charges accordingly.
// This program also stores the aforementioned information in 3 separate files for administrator review.

//Preprocessor calls
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>

//defining namespace
using namespace std;
using std::cin;
using std::cout;
using std::endl;
using std::ifstream;

int main()
{
//declaring variables
ifstream totalFile;
totalFile.open("dayin00.dat");
ifstream ledgerFile;
ledgerFile.open("current11.dat");
ifstream currentFile;
currentFile.open("dayout99.dat");
int menuSelection;
int DVDcurrent;
double moneyCurrent;
int vidboxID;
int returnDVD;
int top10DVD;
int newReleaseDVD;
int standardDVD;
const double top10cost = 4.99;
const double newReleaseDVDcost = 3.99;
const double standardDVDcost = 2.99;
double totalCost;
double discountBOGO;
const double discountID = .35;
double calcDiscount;
double discountAmt;
int totalDVDcount;
int withdrawAmt;
int DVDcalc;
const double tax = .07;


//*****************************************************************************//
// masterID function //
// Utilize this function when master ID is used //
// this function passes no information in or out //
// it only writes to the file after it has been //
// determined in the main program that the master //
// ID has been entered. //
//*****************************************************************************//
void masterID()
{
switch (menuSelection)
{
case '1': cout << "Summary" << endl;
cout << "There are currently " << DVDcurrent << " DVD's in the Vidbox." << endl;
cout << "There is currently $" << moneyCurrent << "in the Vidbox." << endl;
totalFile.close;
break;
case '2': cout << "Withdraw" << endl;
cout << "There is currently $" << moneyCurrent << "in the Vidbox." << endl;
cout << "How much money would you like to withdraw at this time? " << endl;
cin >> withdrawAmt;
ledgerFile.open("current.dat");
ledgerFile >> withdrawAmt;
ledgerFile.close;
break;
case '3': cout << "Close Down" << endl;
currentFile.open("dayout99.dat");
currentFile >> DVDcurrent;
currentFile >> moneyCurrent;
currentFile.close;
break;
default: cout << "This is an invlaid Choice" << endl;
}
}
// End of masterID function
//***************************************************************************************************************


//*****************************************************************************//
// Sale function //
// Utilize this function when user slects to rent DVD's //
// this function passes the ID into it and the total //
// amount the user owes including taxes //
//*****************************************************************************//
double saleDVD(int)
{
cout << "How many new release DVD's would you like to rent? ";
cin >> newReleaseDVD;
cout << endl;
cout << "How many top 10 DVD's would you like to rent? ";
cin >> top10DVD;
cout << endl;
cout << "How many standard DVD's would you like to rent? ";
cin >> standardDVD;
cout endl;



if (newReleaseDVD >= 2)
{
totalCost = newReleaseDVD * newReleaseDVDcost;
totalCost = totalCost - newReleaseDVDcost;
}
else if (top10DVD >= 2)
{
totalCost = top10DVD * top10cost;
totalCost = totalCost - top10cost;
}
else if (standardDVD >= 2)
{
totalCost = standardDVD * standardDVDcost;
totalCost = standardDVD - standardDVDcost;
}
else
{
totalCost = (standardDVD * standardDVDcost) + (top10DVD * top10DVD) + (newReleaseDVD * newReleaseDVDcost);
}
return totalCost;
}

totalFile.open("dayin00.dat");
totalFile >> DVDcurrent;
totalFile >> moneyCurrent;

cout << "Welcome to DMACC Vidbox!" << endl;
cout << " Please enter your 5 digit Vidbox ID#: ";
cin >> vidboxID;

if (vidboxID = 99959)
{
void masterID();
}
else
{
cout << "What would you like to do today?" << endl;
switch (menuSelection)
{
case '1': cout << "You would like to rent some DVD's today." << endl;
double saleDVD(int);
break;
case '2': cout << "You would like to return some DVD's today." << endl;
double returnDVD(int);
break;
default:
cout << "This is an invalid selection. Please start again." << endl;
}
}
return 0;
}
Topic archived. No new replies allowed.