Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Homework Help/Study Tips Expert

Object-Oriented Programming for Electrical and Computer Engineers

Exercise 1 - Random Walk

The following figure illustrates a random walk on an integer grid. You begin at the position Start and you are trying to get to the position Finish. Each time you reach a corner, you choose a direction at random, and take a unit step in that direction. You never wander outside the grid. So, if you are at the Start position, you have a choice of two directions: left and down. You choose one of these at random. If you are in the middle of the grid, you have a choice of four di¬rections: left, right, up and down. You choose one of these at random. Write a program to simu¬late the random walk, stopping when you reach the destination. Utilize the function rand () to generate a random number. Choose an N x N grid of size say N = 8.

Exercise 2 Standard Template Library (STL)

1. Create a Person class, with the person's name, age and the town of residence as the data members. Then create an STL deque of Person objects (≈ 5 objects). Display the contents of the deque.

2. In this problem, you will be utilizing STL vector. Noah and Sofia want to invite their friends to a party. Write a program which does the following:

- Reads the list of Noah's friends names, stores it in a vector, and displays it in sorted order.
- Reads the list of Sofia's friends names, stores it in a second vector, and displays it in sorted order.
- Creates a third vector, merges the contents of the previous two vectors, eliminates duplicates, and displays this list.Assignment 3
Standard Template Libraries (STLs) and Inheritance

Assignment

1. Write an algorithm to print different ways of arranging 4 rooks on a chess board, so that no rook can capture another. That is, none of them share the same row or column. Generate and display a few test cases.

2. Write a program to read in names and scores of N students, from a file. Then find the me- dian of all the scores. Utilize the STL container map. The scores should be in the range [0, 100]. As an example, you may use N = 10;

3. (a) Create an STL set S1 with N1 elements in the range [0, 400].
(b) Create an STL set S2 with N2 elements in the range [200, 600].
(c) Find the intersection of S1 and S2.
(d) Find the union of S1 and S2.
As an example, use N1 = 50, and N2 = 60.

4. Stephen Prata, Chapter 13, Programming Exercise 1 on base class Cd and derived class Classic.

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M92778775
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in Homework Help/Study Tips

Question final paperthe purpose of the final project paper

Question: Final Paper The purpose of the Final Project Paper is for you to culminate the learning achieved in the course by describing your understanding and application of knowledge in the field of Organizational Behavi ...

Question do a cultural comparison of adolescentemerging

Question: Do a cultural comparison of adolescent/emerging adulthood education practices in America compared to another country or countries in the world (provide citations). (Please use Sweden, Lithuania, Scotland, Spain ...

You are a successful manager in a leading commercial bank

You are a successful manager in a leading commercial bank and are attending a meeting with the CEO of your firm. Early in the discussion, he says, "Nobody questions that employees will be happy and motivated in times of ...

Question psychologists have discovered that human beings

Question: Psychologists have discovered that human beings experience several different states of consciousness during the course of a day. For example, people have times when they are especially alert and times when they ...

Question the impact of the health sector reform has been

Question: The impact of the health sector reform has been modified by its critical aspects of the health workforce, including labor conditions, degree of decentralization of management, required skills and the entire sys ...

Instructionsusing the csu online library or reputable

Instructions Using the CSU Online Library or reputable sources on the Internet, locate one or more articles that give detailed information (at least six pages in length) about a fire in either a hotel or a high-rise offi ...

Assignment 1 strategy and performance management at dsmread

Assignment 1: Strategy and Performance Management at DSM Read the case study titled "Strategy and Performance Management at DSM" located in the XanEdu case pack (Link Below) Write a four to five (4-5) page paper in which ...

Group marketing strategy report amp presentation

Group Marketing Strategy Report & Presentation (Presentation 10, Report 20) (10 minutes and 2000 words) Working in groups of no more than four you are required to develop a detailed marketing strategy for the introductio ...

Question by successfully completing this assessment you

Question: By successfully completing this assessment, you will demonstrate your proficiency in the following course competencies and assessment criteria: Competency 2: Evaluate the characteristics, purposes, benefits, st ...

Question a firm that maintains the same organizational

Question: A firm that maintains the same organizational structure for too long may become a competitive loser, but so might one that changes its structure too frequently. Explain. The response must be typed, single space ...

  • 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