Each user has a unique five-digit ID number.Whenever a user logs on, the users's ID,lab number,and the computer station number are transmitted to your system.For example,if the user 49193 logs onto station 2 in lab 3, then your sytem recieves(49193,2,3) as input data.Similarly,when a  user
logs off a station,then your system recieves the lab number and computer station number. write a computer program that could be used to track,by lab which user is logged onto which computer.

I need help with pointers and how to take the user input of id,lab,and station to update the output screen.

[#include<iostream>
using namespace std;


int *Point;


void screen1();
void logon();
void logoff();


int main(){


screen1();
int entry;
cout<<endl;
do{


cout<<"1: Logon\n"
<<"2: Logoff.\n"
<<"3: Search.\n"
<<"4: End\n";
cout<<"Enter a number: ";
cin>>entry;


if(entry==1){
logon();
}
if(entry==2){
logoff();
}



}while(entry<=3);



cout<<endl;
system("pause");
}



void screen1(){
int station1[5],station2[6],station3[4],station4[3];
int lab[5];
for(int x=1;x<=4;x++){


if(x==1){
station1[5];
for(int f=1;f<=5;f++){
station1[f]=0;
}
}


if(x==2){
station2[6];
for(int f=1;f<=6;f++){
station2[f]=0;
}
}


if(x==3){
station3[4];
for(int f=1;f<=4;f++){
station3[f]=0;
}
}


if(x==4){
station4[3];
for(int f=1;f<=3;f++){
station4[f]=0;
}
}



}


int h=1;
for(int a=1;a<=4;a++){


cout<<h<<": ";
if(a==1){
for(int f=1;f<=5;f++){
if(station1[f]==0){
cout<<f<<" empty ";
}
}
cout<<endl;
}


if(a==2){
for(int f=1;f<=6;f++){
if(station2[f]==0){
cout<<f<<" empty ";
}
}
cout<<endl;
}



if(a==3){
for(int f=1;f<=4;f++){
if(station3[f]==0){
cout<<f<<" empty ";
}
}
cout<<endl;
}



if(a==4){
for(int f=1;f<=3;f++){
if(station4[f]==0){
cout<<f<<" empty ";
}
}
cout<<endl;
}


h++;


}


}


void logon(){
int id,station,lab;



cout<<"Enter your 5 digit User ID: ";
cin>>id;
cout<<endl;
cout<<"Enter the lab number: ";
cin>>lab;
cout<<endl;


switch(lab){


case 1:
cout<<"Enter your station(1-5)\n";
cin>>station;
if(station>5){
cout<<"Invalid station!\n";
}
else{
break;
}


case 2:
cout<<"Enter your station(1-6)\n";
cin>>station;
if(station>6){
cout<<"Invalid station!\n";
}
else{
break;
}
case 3:
cout<<"Enter your station(1-4)\n";
cin>>station;
if(station>4){
cout<<"Invalid station!\n";
}
else{
break;
}
case 4:
cout<<"Enter your station(1-3)\n";
cin>>station;
if(station>3){
cout<<"Invalid station!\n";
}
else{
break;
}
}
}



void logoff(){
int id;
cout<<"Enter your User ID to logoff: ";
cin>>id;
cout<<endl;
}



]

Edited 3 Years Ago by happygeek: fixed formatting

Look up use of code tags in the announcement section of this board and then repost your code.

Also clarify what this:

Similarly,when a&Acirc;&nbsp;&Acirc;&nbsp;user logs off a station

means.

This article has been dead for over six months. Start a new discussion instead.