Question: Computer science assignment ( C++).. Each comment of on each step or explain each step. THEORY Assignment # 02 Submission Deadline: SUN, 4th November, 2018

 Computer science assignment ( C++).. Each comment of on each step

Computer science assignment ( C++).. Each comment of on each step or explain each step.

THEORY Assignment # 02 Submission Deadline: SUN, 4th November, 2018 at 11:59 pm | Total Marks: 40 Directions: Please upload the solutions in PDF format on Google Classroom Only, through your accounts. Policy: Any assignment copied will be marked zero and the assignments discarded. Both the original and copied assignments will be treated equally Problem Statements 1. The date June 10, 1960, is special because when we write it in the following format, the month times the day equals the year 6/10/60 Write a program that asks the user to enter a month (in numeric form), a day, and a two digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is not magic (10 Marks) 2. When traveling through a gas, the speed of sound depends primarily on the density of the medium. The less dense the medium, the faster the speed will be. The following table shows the approximate speed of sound at 0 degree Celsius, measured in meters per second, when traveling through carbon dioxide, air, helium, and hydrogen Medium Carbon dioxide Air Helium Hydrogen Speed (meters per sec.) 258.0 331.5 972.0 1270.0 Write a program using switch-case statements that displays a menu allowing the user to select one of these 4 gases. After a selection has been made, the user should enter the number of seconds it took for the sound to travel in this medium from its source to the location at which it was detected. The program should then report how far away (in meters) the source of the sound was from the detection location. Input Validation: Check that the user has selected one of the available menu choices. Do not accept times less thon 0 seconds or more thon 30 seconds. (10 Marks,) 3. Print the integers from 1 to 50 using a while loop and the counter variable x. Assume that the variable x has been declared, but not initialized. Print only 5 integers per line. Hint: when x%5 is 0, print a newline character otherwise, print a tab character t] (10 Marks,) 4. Use for loops to construct a program that asks the user the height in terms of number of X values and then displays a pyramid of Xs on the screen. The pyramid should look like this (10 Marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!