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: 9 Weeks Ago, 2 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 06 Jun 2017 My Price 8.00

C++ ProgrammingHomework 7: High-card simulator

Can you help me with this program, I don't know where to start 

 

Page1of6ITP 165: Introduction to C++ ProgrammingHomework 7: High-card simulatorDue: 11:59pm, March 11th, 2016GoalFor this assignment, you’ll be creating a simulator for an exciting game of High-Card. 2 players randomlypick 2 cards from two different decks. Whoever gets the highest rank (suit doesn’t matter), wins theround. You’ll run the simulator until the user asks for the excitement to stop.SetupCreate a new project in Visual Studio or Xcode calledhw07and a new C++ file namedhw07.cpp.Yourhw07.cppfile must begin with the following (replace the name and email with your actualinformation):// Name// ITP 165, Spring 2016// Homework 07// USC emailPart 1: Struct setupCreate astructcalledCard. It has 2 pieces of data:oAnintto hold the card’s rank – a number from 2 to 14. Where 11 represents a Jack, 12is a Queen, 13 is a King, and 14 is an Ace.oAstd::stringto hold the card’s suit. Suits can be Diamonds, Clubs, Hearts, or Spades.Writemainthat, for now, makes a variable of typeCard, just to test everything.Part 2: cardToString functionCreate a function called “cardToString”. It should accept 1Cardvariable for input and return astd::string. This function will examine the inputted card and generate a string containingsomething like “2 of Clubs” or “Queen of Diamonds”.I recommend creating astd::stringto hold the return value.If the card rank is between 2 and 10, you can set the return value to contain the starting numberlike “5” or “10”.If the card rank is between 11 and 14, you’ll need to decode the rank to Jack, Queen, King, orAce.Next, add the suit of theCardvariable to the return value and return that newstd::string.For now, inside ofmain, create a newCardvariable for testing thecardToStringfunction. Setthe card’s rank and suit to your favorite playing card value.You should be able to display out that card’s information with code similar to:std::cout<<cardToString(testCard) <<std::endl;Be sure to test your function with severalCardvalues/variables.Part 3: makeCard functionCreate a function called “makeCard”. Its job is to createCardvariables for us. It accepts 2 input:

Attachments:

Answers

(11)
Status NEW Posted 06 Jun 2017 02:06 AM My Price 8.00

-----------

Attachments

file 1496717883-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)