diff options
| author | [email protected] <[email protected]> | 2021-11-09 21:27:21 -0800 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2021-11-09 21:27:21 -0800 |
| commit | ec64a30d80f284bf3f1ef2960207f74056dcba28 (patch) | |
| tree | c2ad54bfa4a55658c9dfcc2e46894affb076c895 /CST116F2021-Lab6/CST116F2021-Lab6.cpp | |
| parent | Add online IDE url (diff) | |
| download | cst116-lab6-rayyanansari03-ec64a30d80f284bf3f1ef2960207f74056dcba28.tar.xz cst116-lab6-rayyanansari03-ec64a30d80f284bf3f1ef2960207f74056dcba28.zip | |
LAB6 Answers V1
Diffstat (limited to 'CST116F2021-Lab6/CST116F2021-Lab6.cpp')
| -rw-r--r-- | CST116F2021-Lab6/CST116F2021-Lab6.cpp | 71 |
1 files changed, 67 insertions, 4 deletions
diff --git a/CST116F2021-Lab6/CST116F2021-Lab6.cpp b/CST116F2021-Lab6/CST116F2021-Lab6.cpp index 466d90f..757b51c 100644 --- a/CST116F2021-Lab6/CST116F2021-Lab6.cpp +++ b/CST116F2021-Lab6/CST116F2021-Lab6.cpp @@ -1,13 +1,76 @@ -// CST116F2021-Lab6.cpp : This file contains the 'main' function. Program execution begins and ends there. +// LAB6Ansari-V2.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> +#include <string> +#include <iomanip> +using namespace std; +void acceptStringInfo(string array1[10][2]); +void acceptNumInfo(int studentNum[10], int moneyForClub[10], string array1[10][2]); +int main() { + + int x = 2; + + + string clubInfo[10][2]; + int studentNum[10]; + int moneyForClub[10]; + + acceptStringInfo(clubInfo); + acceptNumInfo(studentNum, moneyForClub, clubInfo); + + cout << "CLUB : PRESIDENT : STUDENTS : BUDGET" << endl; + for (int z = 0; z < 10; z++) { + + cout << clubInfo[z][0] << " : " << clubInfo[z][1] << " : " << studentNum[z] << " : " << moneyForClub[0] << endl; + + } + -int main() -{ - std::cout << "Hello World!\n"; } +void acceptStringInfo(string array1[10][2]) { + + string club; + string clubPresident; + + + + + for (int i = 0; i < 10; i++) { + + + cout << "Enter club name: "; + getline(cin, club); + cout << endl; + array1[i][0] = club; + + cout << "Enter club president name: "; + getline(cin, clubPresident); + cout << endl; + array1[i][1] = clubPresident; + + + } + +} + + +void acceptNumInfo(int studentNum[10], int moneyForClub[10], string array1[10][2]) { + + int members; + + for (int i = 0; i < 10; i++) { + cout << "How many people are in the club " << array1[i][0] << ": "; + cin >> members; + cout << endl; + studentNum[i] = members; + moneyForClub[i] = members * 75; + } + + + +} // Run program: Ctrl + F5 or Debug > Start Without Debugging menu // Debug program: F5 or Debug > Start Debugging menu |