Display the total as the number of points earned

Assignment Help C/C++ Programming
Reference no: EM132076032

You need help with the following progra

Write a C++ program to simulate the following game:

1. The player has two dice to roll.

2. The numbers that are rolled on the sum (Sum1) is checked to see if it is even or odd.

3. If Sum1 is even, then the player gets one more chance to roll the dice.

a. After the player rolls the dice, the sum is generated again. Let us call it Sum2.

b. Now Sum2 is added with Sum1 and the total is checked to see if it is even or odd.

i. If Even, the player won the game. Display appropriate message and display the total (Sum1+Sum2) as the Number of points earned.

ii. If Odd, the player lost the game. Display appropriate message. (Do not have to display points/total)

4. If Sum1 is odd, the player lost the game. Display appropriate message. (Do not have to display points/ total)

The player can repeat this game any number of times. Ask a player if he wants to play the game again. If yes, repeat, else stop.

(Hint: Can use 'y' or 'Y' to represent yes and 'n' or 'N' to represent No.)

Reference no: EM132076032

Questions Cloud

Write a program that reads an unspecified number : Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read.
Explain the concept of patient-centered medical home : Explain the concept of patient-centered medical home (PCMH) to your Uncle and how it will improve the health care he receives.
Calculate the total cost of material : Orr Company makes and sells a single product called a Bik. Calculate the total cost of material A budgeted to be purchased in March
What do you think were the challenges faced by coco cola : What do you think were the challenges faced by Coco Cola when they attempted to enter the Indian market the first time? What did they do wrong?
Display the total as the number of points earned : If Even, the player won the game. Display appropriate message and display the total (Sum1+Sum2) as the Number of points earned.
Produces several lines of oak furniture : Oakmaster furniture inc. produces several lines of oak furniture,ranging from traditional to contemporary.
Write a shell script that copies the file named by its first : Write a script that tests for at least 1 or more arguments in the line calling the script. Write a shell script that copies the file named by its first argument
Create a java class named circle that implements java : Create a Java class named "Circle" that implements java.io.Serializable interface and models a circle based on radius.
Determine barry and connies lowest taxable income : Connie sold for $40,000 property she had inherited from her father in 2010. Determine Barry and Connies lowest taxable income

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program to report on the roots of a quadratic equation

Write a complete C++ program to report on the roots of a quadratic equation ax2 + bx + c = 0, a ≠ 0. compute the roots.

  What is the 2''s complement of f

Both paging and segmentation are forms of contiguous storage allocation.

  Correct code so that it finds the sum of 20 numbers

Correct the following code so that it finds the sum of 20 numbers.

  Explain strings are an important part of programming

Strings are an important part of programming. They are used to transfer all sorts of data between the user and program, as well as from program to program. Humans communicate with streams because they are flexible enough to encode words and vari..

  Implement the polynomial regression algorithm

Write a C program to implement the polynomial regression algorithm

  Implement a program that collects the statistics of word

Implement a program that collects the statistics of word, number, and character usage in a file (redirected as the standard input).

  Write a function which takes a c string

Write a function which takes a C string as an input and counts the number of non-alphabetic characters in the C string. Non-alphabetic characters include anything outside the ranges 'a' thru 'z' and 'A' thru 'Z'.

  Write a system to read from a file list of employee payroll

Write a system to read from a file a list of employee payroll information, calculate net salary amounts based on base salary, bonus, and % deduction.

  Write a recursive definition that reverses the elements

Write a recursive definition that reverses the elements in intArray between low and high.

  Create a simple airline ticket reservation program in c++

When the program is first started, it should read a data file called reservation.dat. If the file exists, the program must load its data for each record into the reservation linked list.

  Use a define statement to create a constant

Follow these specifications: Use a define statement to create a constant that will hold your student number. You should have separate string variables for your first and last name; name these first_name and last_name.

  What must mr harrish do to avoid delay

If the property tax is not paid on time, the Municipal Corporation levies a late fee of R0. 2000. What must Mr. Harrish do to avoid delay in the payment

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd