Machine Problem 6.7
Write a program using string functions that will accept the name of the capital as input value and will display the corresponding country.
CAPITALS COUNTRIES
Ottawa Canada
Washington D.C. United States
Moscow Russia
Rome Italy
Manila Philippines
write a program to find the table of numbers using a while loop. your program should ask about the size of the table. the size defines the rows and columns. sample output
Enter size : 6
1 2 3 4 5 6
----------------------------------
1* 1 2 3 4 5 6
2* 2 4 6 8 10 12
3* 3 6 9 12 15 18
4* 4 8 12 16 20 24
5* 5 10 15 20 25 30
6* 6 12 18 24 30 36
The Program shall:
Note: Cases are ignored. Lowercase letters are acceptable (a, b, c).
Create a try-catch structure to handle three (3) exceptions. These are when the user inputs the following:
Prompt the user that he can answer again if any of the three (3) exceptions is thrown
Display the score.
Explain how overloading a unary operator is almost similar to overloading a binary operator with necessary examples and include main() function to demonstrate. Mention the differences between these two in terms of number of operands they deal with.
which factors are vitally important for designing an optimal algorithm, explain those factors
Create a function to print out all the data for the Student. Remember to prototype this function and use outside of a class function.
Write a program to calculate the correct packaging system for chocolates. A user has the option to put it in a box, or put it in a box inside a container. A box of chocolate bars can hold 30 bars and a container can hold 94 boxes of chocolates. Write a program that prompts the user to enter the total number of chocolate bars. The program then outputs the number of boxes and/or the number of containers to ship the chocolates. Note that each box must contain the specified number of chocolates each container must contain the specified number of boxes. If the last box of chocolates contains less than the number of specified chocolates you can discard it, and output the number of leftover chocolate. Similarly, if the last container contains less than the number of specified boxes, you can discard it, and output
the number of leftover boxes.
1. Write a C++ program that prompts the user for the fuel quantity and the fuel price
per litr
Task:1
A single point has two coordinates p1(x,y). Create a class name Point with a length 2 array asit's private data member. Initialize the array using constructor. Overload array subscript operator ‘[ ]’ for if I have to access the object's array at a particular index from main function
like this.
Point p1(1, 1);
cout << p1[0] << " " << p1[1] << endl;
Task#02:
Copy paste the same task and do consider doing it in dynamic memory instead of static. Plus alter the subscript overloaded function for if I have to make changes to the class array from the main function. Hint: By reference
Point p2(3, 3);
cout << p2[0] << " " << p2[1] << endl;
p2[0] = 7;
p2[1] = 9;
cout << p2[0] << " " << p2[1] << endl;
Digit 9