GROUP 3 C++ Assignemt
GROUP 3 C++ Assignemt
GROUP 3 C++ Assignemt
GROUP ASSIGNMENT
GROUP MEMBERS NAME ID NUMBER
May, 2023
1. Write a program which reads a 3 x 2 matrix and then calculates the sum of each row and
store that in a one dimension array.
#include <iostream>
int main() {
int matrix[ROWS][COLS];
cin >>matrix[i][j];
rowSums[i] += matrix[i][j];
return 0;
}
2. Develop a C++ program that accepts the name of a person and then counts how many
vowels the person's name have.
#include <iostream>
#include <string>
#include <cctype>
int main() {
string name;
int vowelCount = 0;
int consonantCount = 0;
getline(cin, name);
if (isalpha(lowercaseCh)) {
vowelCount++;
} else {
consonantCount++;
return 0;
}
3. Write a C++ program that accepts a word from the user and then displays the word after
reversing it.
#include <iostream>
#include <string>
int main() {
string word;
string reversedWord;
reversedWord += word[i];
return 0;