Write an algorithm to print different ways

Assignment Help Other Subject
Reference no: EM131940119

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.

Verified Expert

It is a c++ assignment where we have to implement STL (Standard Template Library). There were different scenarios to implement the STL like map (key, value), vector. First four problems were to use the algorithm part but later totally depended on the STL implementation in C++. Some of the main functions used with the STL is sort, delete, conversion from one STL logic to other. Problems were to get rich knowledge in the application of the STL using various scenario at the same time with proper implementation of algorithm

Reference no: EM131940119

Questions Cloud

Discuss the major methods of company valuation : Discuss the major methods of company valuation, disadvantages with the other methods you choose to discuss.
Write an analytical report using proposal : This week, you are tasked to write an Analytical Report. Using your Proposal from week three, research the feasibility of your plan.
What are the major limitations of the eoq model : In the EOQ model, unit product cost or selling price, C, is not included in the formula we use to solve for the economic order quantity.
How does ascaris survive the low ph of the stomach : Are humans the definitive host or intermediate? Why is infection uncommon in the US? How does Ascaris survive the low pH of the stomach?
Write an algorithm to print different ways : EEO 224 - Object-Oriented Programming for Electrical and Computer Engineers - Write a program to read in names and scores of N students, from a file.
Technologies in the role of business strategy : Provide examples with respect to technologies applied in a commercial business context.
Please describe the benefits of using systems : Please describe the benefits of using systems thinking and what technique(s) you would use to visually describe a project system.
Why is oversight important to project managers : What is project oversight? Describe each level. Why is oversight important to project managers?
Question on change management : You are a consulting associate with Organizational Development, Inc., a national consulting firm that specializes in helping healthcare organizations

Reviews

len1940119

4/13/2018 1:50:19 AM

2 Discussion Board (3 points) There are points for participating in the Discussion Board. You are encouraged to ask questions on clarifying the assignments or related material, post your thoughts and some hints. Please do not post complete solutions. 3 Grading In addition to code functionality, there will be points for coding style, algorithm design and comments. A few useful comments would be sufficient. 4 Assignment Submission The Assignments must be submitted on the Blackboard, and should include the following: 1. The C++ source code, with one ftle per problem. 2. Screen shots which show each program executing. All the screen shots maybe in a single .pdf or .jpg file.

Write a Review

Other Subject Questions & Answers

  Reform of the legal system

Specifically, give me 2 suggestions for the reform of the legal system. For example, you might suggest some aspect of tort reform, such as a cap on contingency fees, limit on awards to plaintiffs, or having the loser of the lawsuit pay the fee

  What observations support your diagnosis

What diagnosis, if any, best explains Rick's behaviour? What observations support your diagnosis? What more do you need to know to make the diagnosis with greater certainty or to explore other possible diagnoses?  How would you get this information

  Discuss sprawl is a consequence of the market economic

There are three basic factors which cause the urban sprawl. First of all is the market factors. The American urban sprawl is a consequence of the market

  List of the future changes and challenges facing health care

In a 4-5 page paper provide a list of the future changes and challenges facing health care leaders in the future.

  Parent regarding vaccinating the child

As an MA, you have a parent refusing the Measles vaccine. What should a MA communicate to the parent regarding vaccinating the child?

  How to present a professional profile on social media

Incorporate research regarding how to present a professional profile on social media platforms, and discuss your experience in the paper

  Explain in detail what the emotional bank account is

List and explain the six major deposits that must be made to the emotional bank account, what is gained by making those investments?

  Was this entrapment by law enforcement explain

Respond to the questions in both Case Studies - Was this entrapment by law enforcement? Explain your position

  Failed in humility and self discipline

When O'Brien says 'You have failed in humility and self discipline,' he is correct. Winston Smith causes his own suffering. Do you agree? I have NO IDEA what to talk about, I don't even understand the prompt,

  Formulate and develop a sentence for dough

With this information, formulate and develop a sentence for Dough that meets 1 or more of the following goals of corrections

  Interpersonal relationships

What type of power is typically exercised within interpersonal relationships?

  How will you spend your limited funds

Develop a house of quality that helps guide your design of the location (both interior and exterior), operating times, etc. to best fulfill your customers' wishes and help your business be competitive in the marketplace. Try to examine at least 6 ..

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