Define and implement a default constructor for robot class

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

Using C++ programming: Analyze each problem, develop a solution and implement your solution. Copy and paste your program and a sample output below each problem.

Define the class Robot. This class must have two integer type private data members locationX and locationY and a Boolean variable load.

a. Define and implement a default constructor for the Robot class that sets the locations to zero, and load to false (no load is being carried by the Robot)

b. Overload the constructor - define and implement a second constructor function that receives three parameters to set the locations and the load for the Robot.

c. Define four public methods goLeft(), goRight(), goUp(), goDown() with void return type and no parameters. These methods (member functions) move the robot one unit in the requested direction. Should these methods be declared as const?

d. Define and implement a public method (member function) that returns the distance of the robot from the origin. The distance of the point (x, y) from the origin is given by the formula . Think about the parameters the method should receive (if any) and the return type.

e. Define and implement the public method goToOrigin() that moves the Robot one unit at a time back to the (0, 0) location, this method can use goLeft(), goRight(), ... methods to move the Robot.

f. Define and implement the public method goToLocation(int xc, int yc) that moves the Robot one unit at a time to the location (xc, xy) , this method can use goLeft(), goRight(), ... methods to move the Robot.

g. Define and implement the public methods pickUpLoad() and dropLoad(), the first method sets the load variable to true, meaning the robot has a load and the second function sets it to false, meaning the no load is on the Robot.

h. Define and implement accessor/get functions getX() , getY() and getLoad() that return the x and y coordinates of the location as well as the value of the load variable (true[1] or false[0]).

i. Write a main function in which a Robot is instantiated (created), and then prompt the user to enter the x and y coordinates of some load, say a box, for the Robot to go pick up. The user should also enter the x and y location of destination where the box should be dropped. Your programs should steer he Robot to the location of the box, pick up the box a then drop off the box at the destination location.

Reference no: EM13783404

Questions Cloud

Distinctive competence and core competence of hyundai : Distinctive competence and core competence of Hyundai. How have the values and mission statement helped shape the planning. What are some internal and external factors that may influence the business in the future and explain how they will influen..
Describe the history and evolution of health care economics : Describe the history and evolution of health care economics and the timeline of health care funding, using the defined terms. Include two outside resources.
Explain what is the legal definition for sexual harassment : What is the legal definition for sexual harassment? What investigation process should 1995 Auto Corp. have engaged in when the claims were first made? Why will that be important to the defense of the EEOC charge
Project from your place of employment : In this assignment, you will select a program, quality improvement initiative, or other project from your place of employment (I WORK IN ICU). Assume you are presenting this program to the board for approval of funding. Write an executive summary ..
Define and implement a default constructor for robot class : Define and implement a default constructor for the Robot class that sets the locations to zero, and load to false (no load is being carried by the Robot)
Write a two page paper on buying vs renting a home : Write a two page paper on buying vs renting a home.
Physical and mental health of individuals : Generate a chart that demonstrates how the sociological environment influences the physical and mental health of individuals. Include both the physical and social environment and write a synopsis of the influence created by each item on the chart.
Fix the essay which one is more convince gender and languag : Fix the essay "Which One is More convince GENDER AND LANGUAGE".
Create program to determine the median grade : Modify that program to determine the median grade along with the average and the highest and lowest grades

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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