Discuss the private member data

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

Question: You need to write a class sship (spaceship) , it is to have the following private member data:

a. Int ID;

b. String stype;

c. Int manabilty; ///short for maneuverability

d. Int firep; ///short for firepower

e. Int Hits /// number of hits it can sustain

Create two instances of sship, ID=1 is stype Xwing, ID=2 is stype Starfighter. ID 1, has manabilty = 77 and firepower = 80, hits = 3 ID 2, has manability 85 and firepower 66, hits = 2 Allow them to fight in the following manner: ID 1 rolls a random number with mean=firepower, standard deviation = 10 if this is greater than the manability of ID 2 then ID 2 hit count is reduced by 1 ID 2 rolls a random number with mean=firepower, standard deviation = 10, if this is greater than the manability of ID 1 then ID 1 hit count is reduced by 1 Repeat until one is destroyed. Display the winner to the screen. Repeat combat 100 times in a loop, and report the number of wins for ID 1, ID 2 and the number of times they are both destroyed. c++ code.

Reference no: EM131492660

Questions Cloud

Why is cash flow planning and budgeting so important : What is the difference between a financial manager's view of stock market and financial accountant's view? Why is cash flow planning and budgeting so important.
Evaluate a periodical or newspaper article : Locate and evaluate a periodical or newspaper article in print or online (e.g,, Wall Street Journal, New York Times, Time magazine
Review of the literature organized by themes : Write a 10-12-page traditional Literature Review on the topic you have been researching throughout this course. Review of the literature organized by themes.
What allow people to productively resolve that dissonance : What impact might this have on their beliefs? What might allow people to productively resolve that dissonance
Discuss the private member data : You need to write a class sship (spaceship) , it is to have the following private member data.
Assume further that long-term annual market return : Assume that Constant-Growth DDM is appropriate valuation model for stock index. Assume further that long-term annual market return is expected to be
Explain what accommodations would you implement : What accommodations/modifications would you implement? Explain. What elements of the accommodations/modifications would be most effective?
What were the ethical implications : For this assignment, please answer the following four questions- What did Milgram find out? What were the ethical implications
Evaluate the performance of a system software : Explain why it is important to monitor and evaluate the performance of a system's software as well as its hardware.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Sorting the students based on the graduation date

Sorting the students based on the graduation date - Sorting the students based on GPA - Your program should also compile and run. The user of the program should not notice any difference when running the program with any of your implementations for..

  Takes n number of element from user

Write a C program which takes n number of element from user (where, n is specified by user) and stores data in an array. Then, this program displays the largest element of that array.

  Examine contemporary homeland security issues

Current Event assignments are designed to give you an opportunity to critically examine contemporary Homeland Security issues. You are challenged to find news articles, press releases, industry announcements, etc.

  Prompts the user to enter an integer

Write the code that prompts the user to enter an integer between 1 and 20 (including 1 and 20), reads the value using cin, and then prints the value that they entered in a statement that begins with "You entered a ". Save this version in a separate l..

  Macro definitions

Given the following macro definitions #define HEIGHT 3#define WIDTH 5 There is a multidimensional array called anArray declared as follows:

  What are four examples of how direction can be used

What are four examples of how "direction" can be used in an effective publication?

  Part asuggest an application system which is able to

part asuggest an application system which is able to perform some arithmetic computations like commission system

  Machine that i would like to know

Let's say I have a machine that I would like to know, on average, how much it runs throughout a given day through a percentage value. Every 30 seconds, I will have a device to record the current temperature of the machine. If the machine increases..

  Write a only the client program

If the command is ADD then the details roll number and name will be added to a file. After adding the current request the file is sent back to the client. Write a only the client program.

  We can combine assignment statements

We can combine assignment statements, for-loops, and if statements to perform a wide range of tasks with lists. Suppose we have a bookstore with each book defined as follows: Book = namedtuple('Book', 'author title genre year price instock') , wher..

  Write cpp program to implement a singly linked list of books

Write a C++ program to implement a singly linked list of books. The book details should include the following: title, author, and ISBN.

  Program to produce a monthly sales report

As indicated, the report should also display the total number of automobiles sold by each salesperson and the total number of each model sold by all salespersons.

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