|
-
February 9th, 2009, 05:35 PM
#1
I finished my project, but I have two bugs, help please
Goal of project: create a menu system so I can intergrate all current and future labs
problem: my prelab 0, which ask for basic user inputs, and relaying that information, is skipping the first question. it works fine by itself in its own main program. my second problem is that I'm not writing the exiting code right. I can exit fine if I choose exit as my first option but if I choose exit after using the program, it wont exit.
I'm using VS 2008 C++
Code:
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include "iostream"
#include <string>
void lab_1(void);
void menukeys(void);
#pragma once
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#include <stdafx.h>
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
void lab_1(void) //this is actually lab0
{
cout << "Enter Your Name: ";
string name;
getline(cin, name);
cout << "Enter Your Email Address: ";
string email;
getline(cin, email);
cout << "Enter Your Telephone Number: ";
string phone;
getline(cin, phone);
cout <<endl;
cout << name << "\n" << email << "\n" << phone << endl << "\n";
}
#include "stdafx.h"
using namespace std;
void menukeys(void) //this is lab1
{
int select;
char next;
cout << "ECET344 Laboratory Project Menu\n0. Pre-Lab std I/O\n1. Lab 1 The Menu\n2. Lab 2 is Under Construction\n3. Lab 3 is Under Construction\n4. Lab 4 is Under Construction\n5. Lab 5 is Under Construction\n6. Lab 6 is Under Construction\n7. Lab 7 is Under Construction\n8. Lab 8 is Under Construction\n9. Lab 9 is Under Construction\nq. to terminate the project program\n";
cin >> select;
while (select <10)
{
switch (select)
{
case 0:
{
lab_1();
cout << "Press any key to continue";
cin >> next;
menukeys();
break;
}
case 1:
{
menukeys();
break;
}
case 2:
{
cout << "Lab 2 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
case 3:
{
cout << "Lab 3 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
case 4:
{
cout << "Lab 4 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
case 5:
{
cout << "Lab 5 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
case 6:
{
cout << "Lab 6 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
case 7:
{
cout << "Lab 7 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
case 8:
{
cout << "Lab 8 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
case 9:
{
cout << "Lab 9 is not ready \n\n";
cout << "Enter any key to continue: ";
cin >> next;
menukeys();
break;
}
default:
{
cout << "Good BYE!\n";
select = 10;
break;
}
}
}
}
#include "stdafx.h"
#include "iostream"
#include <string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[]) //this is the main
{
menukeys();
return 0;
}
#include "stdafx.h"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|