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: 103 Weeks Ago, 3 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

Chapter 5Write a program that generates random numbers

here' a new assignments

 

Chapter 5

 

Write a program that generates random numbers between 1 and 10 and fill an array of size 20 with them. Have your program sort the array then output in order the number of occurrences of each random number generated. Use the STL sort function to sort your array.

 

How to use the STL sort:

 

#include <algorithm>

...

int a[20]

...

sort(a,a+20);

 

 

 

Chapter 6

 

Write a class that represents a player in a game. The player should have a name, password, experience points, an inventory array of four strings, and a location x,y. Your class should have mutator and accessor methods for all variables. For example: setName(), getName(). It should have a suitable display method. Mutators and accessors should be public but all variables should be private. To implement get inventory, use string * getInv(); Use the scope resolution operator to implement larger methods such as display(). Use in class methods for shorter methods such as setName(), getName().

 

 

also going to attach both chapters files , with outputs

 

 

 

 

 

Chapter 5Write a program that generates random numbers between 1 and 10 and fill an array ofsize 20 with them.Have your program sort the array then output in order the number ofoccurrences of each random number generated.Use the STL sort function to sort yourarray.How to use the STL sort:#include <algorithm>...int a[20]...sort(a,a+20);I recommend pseudo code to develop an algorithm before coding this.Example Output:This program generates random numbers and tabulates the resultsOriginal List Sorted:a[ 0]1a[ 1]1a[ 2]1a[ 3]2a[ 4]2a[ 5]3a[ 6]6a[ 7]6a[ 8]6a[ 9]7a[10]8a[11]8a[12]8a[13]9a[14]9a[15]9a[16]9a[17] 10a[18] 10a[19] 10N Count1:32:23:14:05:06:37:18:39:4

Attachments:

Answers

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

-----------

Not Rated(0)