Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Objectives:

At the conclusion of this programming assignment, participants should be able to:

Apply repetition structures within algorithms

Construct while (), for (), or do-while () loops in C

Apply pointers, output parameters, and/or arrays in C

Compose C programs consisting of sequential, conditional, and iterative statements

Eliminate redundancy within a program by applying loops and functions

Create structure charts for a given problem

Determine an appropriate functional decomposition or top-down design from a structure chart

Generate random numbers for use within a C program

Prerequisites:

Before starting this programming assignment, participants should be able to:

* Analyze a basic set of requirements and apply top-down design principles for a problem

* Customize and define C functions

* Apply the 3 file format: 1 header file and 2 source files

* Open and close files

* Read, write to, and update files

* Apply standard library functions: fopen (), fclose (), fscanf (), and fprintf ()

* Compose decision statements ("if" conditional statements)

* Create and utilize compound conditions

* Summarize topics from Hanly & Koffman Chapter 4 & 5 including:

* What are counting, conditional, sentinel-controlled, flag-controlled, and end file-controlled loops

* What are while (), do-while (), and for () loops

* What is a selection or conditional statement

* What is a compound condition

* What is a Boolean expression

* What is a flowchart

Develop and implement an interactive two-player Yahtzee game. Yahtzee is a dice game that was invented by Milton Bradley and Edwin S. Lowe in 1956. The challenge of the game is to outduel the other player by scoring the most points. Points are obtained by rolling five 6-sided die across thirteen rounds.

During each round, each player may roll the dice up to three times to make one of the possible scoring combinations. Once a combination has been achieved by the player, it may not be used again in future rounds, except for the Yahtzee combination may be used as many times as the player makes the combination.

Each scoring combination has different point totals. Some of these totals are achieved through the accumulation of points across rolls and some are obtained as fixed sequences of values.

You may design the Yahtzee game with functions that you see fit. I recommend that you start with a structure chart and determine sub-problems and functions accordingly. You must also take advantage of applying pointers, output parameters, and/or arrays! Your Yahtzee game must also implement the following algorithm:

(1) Print a game menu for Yahtzee with the following options:

1. Print game rules
2. Start a game of Yahtzee
3. Exit

(2) Get a menu option from the user; clear the screen

(3) If option 1 is entered, then print the game rules stated above and repeat step (1) otherwise if option 2 is entered, then continue on to step (4); player 1 starts the game otherwise if option 3 is entered, then print a goodbye message and quit the program otherwise repeat step (1)

(4) Ask the player to hit any key to continue on to roll the five dice

(5) Roll the five dice and display the face values of each die; enumerate each die with a number 1 - 5; add 1 to the total number of rolls for this round

(6) If the total number of rolls for this round is less than three, then ask the player (Y/N) if he/she wants to use the roll for one of the game combinations otherwise a combination must be selected

1. Sum of 1's 7. Three-of-a-kind

2. Sum of 2's 8. Four-of-a-kind

3. Sum of 3's 9. Full house

4. Sum of 4's 10. Small straight

5. Sum of 5's 11. Large straight

6. Sum of 6's 12. Yahtzee

13. Chance

(7) If the number of rolls is three or "yes" is entered, then save the combination and it may not be selected again in the future; continue on to step (8); clear the screen

otherwise if "no" is entered, ask the user which dice to re-roll (1 - 5); re-roll the selected die or dice; clear the screen; repeat step (6)

otherwise repeat step (6)

(8) Alternate players

(9) If each player has rolled for the round, then increment the round number if the round number is equal to 14, then continue on to step (10) otherwise repeat step (4) otherwise repeat step (4)

(10) If the total score in the upper section is greater than or equal to 63 for a player, then add 35 points to the total score

(11) Print the scores for both players and print the winner

(12) Repeat step (1)

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91224630
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in C/C++

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As