ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 04 May 2017 My Price 8.00

68-501: Principles of Programming

Hello, I need help with the documents attached. These are due soon!!!!!! Any help is appreciated.

 

68-501: Principles of Programming
Homework for Week 4: Deal or No Deal In this assignment, we will create a modified version of the gameshow “Deal or No Deal”. In
the real show, twenty-five scantily clad women hold suitcases on podiums. Each suit case
contains one of the following dollar amounts: 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750,
1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 750000,
1000000. Contestants pick the number of the case they wish to open, and that amount of
money is then removed from the board. Along the way, some veiled dude in a room upstairs
offers the contestant a settlement to end the game. If the user chooses to continue rather than accept the settlement, he
continues to pick numbers. Eventually, a stopping point is reached, and the person gets to take home the money that
remains on the board.
For this assignment, you will write a program that models a slight variation of this game. The user will have an
opportunity to choose ten numbers between 1 and 25. These ten numbers represent the cases he or she wishes to open.
The dollar amount stored in each case is deducted from the player’s take-home earnings. After the player has finished
selecting all ten cases, the program will tell the user how much money he or she has run.
Here is an example of how the game will look:
Enter the number of the money case to open (1 through 25): 4
$25 has been taken off the board.
Enter the number of the money case to open (1 through 25): 15
$300000 has been taken off the board.
Enter the number of the money case to open (1 through 25): 17
$750000 has been taken off the board.
Enter the number of the money case to open (1 through 25): 16
$1000000 has been taken off the board.
Enter the number of the money case to open (1 through 25): 24
$750 has been taken off the board.
Enter the number of the money case to open (1 through 25): 25
$75 has been taken off the board.
Enter the number of the money case to open (1 through 25): 21
$1 has been taken off the board.
Enter the number of the money case to open (1 through 25): 23
$200000 has been taken off the board.
Enter the number of the money case to open (1 through 25): 3
$1000 has been taken off the board.
Enter the number of the money case to open (1 through 25): 12
$100 has been taken off the board.
You have won $1166465. As always, let me know if you have questions. 1

68-501: Principles of Programming
Questions to Study for Week 4
The midterm exam will cover weeks 1 through 4. To review weeks 1 through 3, study
the review sheets posted for those weeks. To review week 4’s material, study the
list of questions here.
1. Declare an array of 5 ints called numbers.
2. Write a single line of code that will create an array called nums of the 3 int
values 1, 2, and 3.
3. How much memory is set aside by the following commands? Show your work.
int nums[4];
double vals[5];
4. Suppose I have loaded 10 values into an int array called nums. Write code that will
output every other value in the array to the screen, starting with the first
value. Suppose the length of the array is stored as the variable count.
5. Suppose I have an array of 5 integers called nums. Write code that will find and
print the largest value in the array.
6. Suppose I have an array of ints called numbers that has 5 values in it. Write code
that reverses the order of the values in the array, such that the value that was
last will now appear first, and vice-versa.
7. Why is it advantageous to break a program into multiple functions.
8. Declare a function called ConvertTemp that takes in a temperature in fahrenheit and
returns the corresponding temperature in Celsius. Note that C = 5/9*(F-32).
9. Write a function called GreetUser that takes in a person’s name and print “Hello,
____” to the screen (where “_____” is replaced by the person’s name).
10. What is wrong with the following code?
for (int i = 0; i < 10; i++) {
int x = 4;
cout << i << endl;
}
cout << x << endl;
11. What does it mean to overload a function? What is an advantage of doing so? 1

Attachments:

Answers

(11)
Status NEW Posted 04 May 2017 04:05 AM My Price 8.00

-----------

Not Rated(0)