Skip to main content

Posts

c++ Programming -11a -do/while

In this programming, we will cover everything we have cover in our c++ programming including switch case, if/else, gotoxy coordination, do/while and system clear First, code for 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 #include #include #include #include using namespace std; // TODO: reference additional headers your program requires here Name the main file anyhow you like. Programming codes for the main file below: // IntAirways.cpp : Defines the entry point for the console application. // #include "stdafx.h" void menu(); void main(); void load_flight1(); void load_flight2(); void load_flight3(); void generate_report(); void exit(); int i=0, y=0, x=0; //setup lools for element of parcels. int space1=0, space2=0, space3=0; // for calculating space left over // afte...

c ++ Programming - 2 - Selective structure - switch case / statement

This covers Selective structure - switch statement First, code for 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 Name the main file anyhow you like. And the code for the main file below: // swtcase.cpp : Defines the entry point for the console application. // #include "stdafx.h" void main () { int number; cout >number; switch (number) { case 1: cout Check the video on how this works on YouTube here: http://youtu.be/z7sYQqHp51A

c ++ Programming - 1 - c++ Programming - 1 : cin / cout

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: // 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 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: // 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. //Addition...