How to write simple programs that get input from the user

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

Assignment -

INTRODUCTION: In this assignment, you will demonstrate how to write simple programs that get input from the user, produce output, perform simple calculations, make decisions, perform iteration/repetition, and create arrays.

ASSIGNMENT: Candy Land

Write a program that simulates playing a simplified version of the game "Candy Land." In "Candy Land" players take turns drawing cards that have a colored square on them. The player then travels on the board according to the color on the card. The first person to reach the end of the board wins.

In this version, we will practice using arrays and enums. We will use an array of ints to represent the players of the game. You should have an int array of size 4, then you will prompt the user for the number of players from 2 - 4 and this will determine how much of the array you will use. You will create an enum type CARD. The values of the enum will be the possible color of the card. Value 0 should represent an empty deck, and you should have 6 colors (RED, PINK, BLUE, GREEN, YELLOW, ORANGE).

To draw a card you will read a number from cards.txt. Write a function that takes an ifstream as an input parameter and returns a CARD. Read a number from the file and convert the number to a variable of the CARD type.

After prompting for the number of players use a loop to draw cards for each player. After drawing a card, move the player by adding the card value to the player total. The game will end either when a player reaches 20 or there are no more cards (input file reaches the end). The winner is the first player to have a score of 20 or more, or the player with the most points after all the cards have been drawn.

The program should output for each player's turn the current player, the card they drew, how many spaces they move, and their location after moving (total score).

Attachment:- Assignment Files.rar

Reference no: EM132295282

Questions Cloud

Banners and handbills and employees have the right : Banners and handbills are. Employees have the right. The NLRA forbids unions:
Explore how to identify and develop high-potential talent : Explore how to identify and develop high-potential talent. Determine the effects of leadership in the management of talent pools and the talent review process.
What were the signs of acute radiation sickness : What were the signs of acute radiation sickness and when and with whom did they begin? What behaviors of the terrorist were clues that they were terrorists?
Discuss the key features of a teachers role as model : Discuss the key features of a teacher's role as model, provider, and facilitator in promoting language learning and literacy.
How to write simple programs that get input from the user : Write a program that simulates playing a simplified version of the game "Candy Land." Demonstrate how to write simple programs that get input from the user
Developing global leaders through membership on global teams : Developing global leaders through membership on global teams. There is a discussion on merger/acquisition for T-Mobile.
Walmart and globalization : A 2004 Frontline documentary on PBS chronicled the rise of Walmart to the global giant it has become.
Which starbucks rewards feature in the mobile app : Which Starbucks Rewards feature in the mobile app is the most valuable to the company?
Create development plan : Create a development plan that explains how you can best build upon your strengths and overcome your challenges to motivate and lead teams.

Reviews

len2295282

4/28/2019 9:42:25 PM

HOW TO SUBMIT YOUR ASSIGNMENT - At the top of every C++ program, you should have at least four lines of documentation: Program name (the C++ file name(s)), Author (your name), Date last updated, and Purpose (a brief description of what the program accomplishes). The program should output for each player's turn the current player, the card they drew, how many spaces they move, and their location after moving (total score). NOTE: Any assignments missing source code or assignments that do not compile will automatically receive a grade of 0. (You will have 1 week to contact me and revise the assignment for partial credit). Submit only your source code file (*.cpp) Thank you!

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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