Tuesday, October 01, 2019
Monday, July 29, 2019
Monday, July 22, 2019
Classes & Implements
Class Example:
https://repl.it/@LarryHobbs/InsistentGiganticPoint
Simple Tic Tac Toe:
https://repl.it/@LarryHobbs/SimpleTicTacToe
Same Tic Tac Toe, but implementation files:
https://repl.it/@LarryHobbs/TicTacToeImp
https://repl.it/@LarryHobbs/InsistentGiganticPoint
Simple Tic Tac Toe:
https://repl.it/@LarryHobbs/SimpleTicTacToe
Same Tic Tac Toe, but implementation files:
https://repl.it/@LarryHobbs/TicTacToeImp
Struct with functions
Try changing the keyword Struct to Class and see if this works. Then add Public and see if works....
https://repl.it/@LarryHobbs/StructWithFunction
https://repl.it/@LarryHobbs/StructWithFunction
Monday, June 24, 2019
Array Examples
Array Functions
https://repl.it/@LarryHobbs/BountifulPracticalTruespace
Parallel Arrays
https://repl.it/@LarryHobbs/StableHonestKeygenerator
Sequential Search
https://repl.it/@LarryHobbs/ShinyBrilliantExecutables
2-dimensional array
https://repl.it/@LarryHobbs/AgitatedNavyblueProfessional
Multi-Demisional
https://repl.it/@LarryHobbs/Theater
https://repl.it/@LarryHobbs/BountifulPracticalTruespace
Parallel Arrays
https://repl.it/@LarryHobbs/StableHonestKeygenerator
Sequential Search
https://repl.it/@LarryHobbs/ShinyBrilliantExecutables
2-dimensional array
https://repl.it/@LarryHobbs/AgitatedNavyblueProfessional
Multi-Demisional
https://repl.it/@LarryHobbs/Theater
Wednesday, June 12, 2019
Tuesday, April 23, 2019
Class Implement Example
https://repl.it/@LarryHobbs/SimpleTicTacToe
https://repl.it/@LarryHobbs/TicTacToeImp
https://repl.it/@LarryHobbs/Integer-Manipulation-Implement
https://repl.it/@LarryHobbs/TicTacToeImp
https://repl.it/@LarryHobbs/Integer-Manipulation-Implement
Tuesday, February 26, 2019
Tuesday, December 11, 2018
Tuesday, October 09, 2018
Monday, July 30, 2018
Thursday, July 12, 2018
Wednesday, June 27, 2018
Monday, June 11, 2018
Thursday, April 19, 2018
Monday, March 19, 2018
Thursday, March 15, 2018
Chapter 7 Homework Conditions and Test Results
Test 1
Enter a string: Larry Hobbs
Before removing vowels: Larry
After removing vowels: Lrry
Test 2
Enter a string: LarryHobbs
Before removing vowels: LarryHobbs
After removing vowels: LrryHbbs
Test 3
Enter a string: ThankGodItIsFriday
Before removing vowels: ThankGodItIsFriday
After removing vowels: ThnkGdtsFrdy
Test 4
Enter a string: ILoveC++
Before removing vowels: ILoveC++
After removing vowels: LvC++
Test 5
Enter a string: abcdefghijklmnopqrstuvwxyz
Before removing vowels: abcdefghijklmnopqrstuvwxyz
After removing vowels: bcdfghjklmnpqrstvwxyz
Test 6
Enter a string: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Before removing vowels: ABCDEFGHIJKLMNOPQRSTUVWXYZ
After removing vowels: BCDFGHJKLMNPQRSTVWXYZ
Sample of multi-dimensional array done in class
#include "stdafx.h"
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
const int NO_ROOMS = 4;
const int NO_LEVELS = 3;
const int NO_ROWS = 9;
const int NO_SEATS = 15;
const string filler = " _____________________________________________________________";
enum room { ROOM1, ROOM2, ROOM3, ROOM4 };
enum level { FRONT, MIDDLE, UPPER };
enum rows { A, B, C, D, E, F, G, H, I, J };
int main()
{
char theater[NO_ROOMS][NO_LEVELS][NO_ROWS][NO_SEATS];
int i, j, k, l;
char seat;
for (i = 0; i < NO_ROOMS; i++)
for (j = 0; j < NO_LEVELS; j++)
for (k = 0; k < NO_ROWS; k++)
for (l = 0; l < NO_SEATS; l++)
theater[i][j][k][l] = ' ';
theater[2][2][5][8] = 'X';
theater[1][3][10][15] = 'X';
theater[2][1][9][2] = 'X';
for (i = 0; i < NO_ROOMS; i++)
{
cout << "Room " << i + 1 << endl;
for (j = 0; j < NO_LEVELS; j++)
{
cout << " Level " << j + 1 << endl;
cout << filler << endl;
for (k = 0; k < NO_ROWS; k++)
{
cout << "Row " << k + 1 << "|";
for (l = 0; l < NO_SEATS; l++)
{
if (theater[i][j][k][l] == 'X')
cout << " " << theater[i][j][k][l] << " |";
else
cout << " " << l << " |";
}
cout << endl << filler << endl;
}
cout << "\n\n";
}
}
}
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
const int NO_ROOMS = 4;
const int NO_LEVELS = 3;
const int NO_ROWS = 9;
const int NO_SEATS = 15;
const string filler = " _____________________________________________________________";
enum room { ROOM1, ROOM2, ROOM3, ROOM4 };
enum level { FRONT, MIDDLE, UPPER };
enum rows { A, B, C, D, E, F, G, H, I, J };
int main()
{
char theater[NO_ROOMS][NO_LEVELS][NO_ROWS][NO_SEATS];
int i, j, k, l;
char seat;
for (i = 0; i < NO_ROOMS; i++)
for (j = 0; j < NO_LEVELS; j++)
for (k = 0; k < NO_ROWS; k++)
for (l = 0; l < NO_SEATS; l++)
theater[i][j][k][l] = ' ';
theater[2][2][5][8] = 'X';
theater[1][3][10][15] = 'X';
theater[2][1][9][2] = 'X';
for (i = 0; i < NO_ROOMS; i++)
{
cout << "Room " << i + 1 << endl;
for (j = 0; j < NO_LEVELS; j++)
{
cout << " Level " << j + 1 << endl;
cout << filler << endl;
for (k = 0; k < NO_ROWS; k++)
{
cout << "Row " << k + 1 << "|";
for (l = 0; l < NO_SEATS; l++)
{
if (theater[i][j][k][l] == 'X')
cout << " " << theater[i][j][k][l] << " |";
else
cout << " " << l << " |";
}
cout << endl << filler << endl;
}
cout << "\n\n";
}
}
}
Thursday, March 08, 2018
Chapter 6 Homework Conditions and Test Results
Test 1 Enter yearly income: 15000 Enter the hourly rate: 70 Enter consulting time in minutes: 75 The billing amount is: 21.00 Test 2 Enter yearly income: 50000 Enter the hourly rate: 70 Enter consulting time in minutes: 20 The billing amount is: 0.00 Test 3 Enter yearly income: 50000 Enter the hourly rate: 70 Enter consulting time in minutes: 21 The billing amount is: 0.82 Test 4 Enter yearly income: 150000 Enter the hourly rate: 50 Enter consulting time in minutes: 180 The billing amount is: 93.33 Test 5 Enter yearly income: 35000 Enter the hourly rate: 25 Enter consulting time in minutes: 90 The billing amount is: 20.42
Subscribe to:
Posts (Atom)