Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write one single complete C++ program to do all two sections below: (Program must be able to compile ) Part A: (from pract3.pdf) Write a

Write one single complete C++ program to do all two sections below: (Program must be able to compile )

Part A: (from pract3.pdf)

Write a function called smallCol that calculates and returns the smallest possible sum of entries of any column in a 2-dimensional array.

For example, a program that uses the function smallCol follows.

int main() {

int x[2][3] = {{3, 1, 4}, {1, 5, 9}};

cout << "Smallest column sum = " << smallCol (x, 2, 3) << endl;

// from the 2-d array x that has size 2 x 3, find the smallest col sum

// output will be 4 since col#0 contains 3 and 1 is smallest.

return 0;

}

Part B: Write 3 functions:

toUpperCase converts all the characters in the given String to upper case.

Note: Do not use toupper or tolower functions. Refer to Dr. Ryba's code from:

http://venus.cs.qc.edu/~ryba/cs111/Ch7/charArith.cpp

toLowerCase converts all the characters in the given String to lower case.

equals determines if both string are the same.

Program asks user to input two strings in main ().

Then, it will display them in uppercase and lowercase values.

Finally, it will check and see if both strings are equal.

Sample I/O #1

Please enter two words: hello hello Words in uppercase: HELLO HELLO Words in lowercase: hello hello

Both strings are equal.

Sample I/O #2

Please enter two words: Hello hellO Words in uppercase: HELLO HELLO Words in lowercase: hello hello

The input strings are different.

Sample I/O #3

Please enter two words: 333 333

Words in uppercase: 333 333

Words in lowercase: 333 333 Both strings are equal.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions