First quick application covering why you may get iostream, cin and cout errors.
Programming code provided below:
Copy the following codes into the header file: -
stdafx.h:
Copy the main code for the main file:
3_test.cpp But you can name your file anything. Below is the rest of the programming codes:
Check the video on how this works on YouTube here:
http://youtu.be/xSYHLfQOnak
Programming code provided below:
Copy the following codes into the header file: -
stdafx.h:
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include#include using namespace std; // TODO: reference additional headers your program requires here
3_test.cpp But you can name your file anything. Below is the rest of the programming codes:
// 3_test.cpp : Defines the entry point for the console application. // #include "stdafx.h" //Percentage marks attained by a student in three exams //are to be entered to a computer. An indication of Pass //or Fail is given out after the three marks are entered. //The criteria for passing are as follows: //A student passes if all three examinations are passed. //Additional a student may pass if only one subjects is //failed and the overall average is greater than or equal //to 50. The pass mark for an individual subject is 40. #includevoid main() { float i, x, y, av; cout<<"Enter percentage mark for 1st exam (40=pass,10=fail):"; cin>>i; cout<<"\n\nEnter percentage mark for 2nd exam:"; cin>>x; cout<<"\n\nEnter percentage mark for 3rd exam:"; cin>>y; av=(i+x+y/3); if (av>=50) { cout<<"\n\nCongratulations\t"<<"you have pass the test!."; } else cout<<"\n\nYou have failed\t"<<"better luck next time!."; system("PAUSE"); //return(0); }
Check the video on how this works on YouTube here:
http://youtu.be/xSYHLfQOnak
Comments
Post a Comment