Clearing Screen and displaying new screen

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 #include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace 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.

Now, read this link: http://www.cplusplus.com/articles/4z18T05o/
algorithm header file had all of you need.

look it up or search algorithm.h

if you are using nonVS
Last edited on
Topic archived. No new replies allowed.