I am trying to write a program that has multiple options, basically if i press the values corresponding to "double exit" the screen will close and if i press values corresponding to "double voltage" a new screen must appear, but if i press any other values the screen should refresh and show the main screen
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
usingnamespace std;
int main ()
{
// local variable declaration:
double voltage = 1,v,V;
double exit = 0,e,E;
cout << " Vladislav Gudkov Scientific Analysis \n\n\n"<< endl ;
cout << " 1. V)oltage values across a capacitor table\n\n\n\n\n\n\n\n\n\n\n 0. E)xit\n\n enter choice: ";
// dont know how to use if statements here or do I loop , not exactly sure
return 0;
}
Ok. fist to clear some things: console and standard output are not intended for that. C++ even does not know about screen existence (as not all computers have screens).
Unless you are using a library which would handle that gracefully, you can do it in a way that either platform dependend or highly unportable.