with C++ You will create a program that uses a Critter class to move around a Grid, which is also a class. The Critter and the Grid classes will be in separate files. The Critter class will have a data member to count the number of moves made. It will also need data members to hold the current x and y coordinates. It will have a member function that randomly moves it one space in one of 4 directions. You will create both the source and header files for the class. The Grid class has a 2D array data member. This will be an array of type character. It will have an updateLocation() function that will be used by the Critter class to pass the new location of the Critter to be displayed. For the array ou will use a space character, ‘ ‘ for empty and a single ‘C’ for the location of the Critter. The Grid will have one Critter that moves around. The starting location will be random. The Critter will move around until it would exit the gird. In that case it is squashed. The program should terminate normally and tell the user how many steps the Critter took. After every move the grid will be displayed to the user. Hint: For testing, use small arrays. There’s only one Critter after all. You will create a program that prompts the user for the number of rows and columns. It must be at least 1 x 1. It will create the Grid and Critter, run the simulation, display the grid after each move, and inform the user when the Critter gets squashed showing the number of moves made. Files should include: Critter.h Critter.cpp Grid.h Grid.cpp Main.cpp
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
with C++ You will create a program that uses a Critter class to move around a...
*Using C++* You will create a program that uses a Critter class to move around a Grid, which is also a class. The Critter and the Grid classes will be in separate files. The Critter class will have a data member to count the number of moves made. It will also need data members to hold the current x and y coordinates. It will have a member function that randomly moves it one space in one of 4 directions. You...
JAVA You are given a class Critter which represents an animal. Critter class will be the superclass of a set of subclasses classes. A Critter has a weight and a position on a number line. The constructor initializes the position to 0 and sets the weight from the parameter. Critter has an ArrayList of Strings to keep a log of its activities. It has other methods which you can view here You are to implement the following subclasses of Critter...
Program must be written in C++: The goal for this Programming Project is to create a simple two-dimensional predator-prey simulation. In this simulation the prey are ants and the predator are doodlebugs. These critters live in a world composed of 20 x 20 grid of cells. Only one critter may occupy a cell at a time. The grid is enclosed, so a critter is not allowed to move off the edges of the world. Time is simulated in time steps....
In c++ Write a program that contains a class called Player. This class should contain two member variables: name, score. Here are the specifications: You should write get/set methods for all member variables. You should write a default constructor initializes the member variables to appropriate default values. Create an instance of Player in main. You should set the values on the instance and then print them out on the console. In Main Declare a variable that can hold a dynamcially...
A mechanical turtle walks around a room under the control of a C++ program. Note: There is no animation of the turtle walking around the room The turtle holds a pen in one of two positions, up or down. When the pen is down the turtle draws out the shape as it moves. When the pen is up, the turtle moves about freely without writing anything. For this assignment you will write a program to simulate the operation of the...
ASSIGNMENT: Create a program to do the following: BONUS: A bonus of 20 points if you create the program in such a way that there is no limit on the number of names to be handled. 1) Read in names to sort until the user types the “enter” key as the first character of a “C-type” string (the maximum number of names is 20, there is not a maximum length to a name), using a two dimensional array of characters....
Create a C++ program to : Prompt user for seven test score Store the scores into an array Print the array before and after sorting Print the test average Convert the average to letter grade Search for a test score 90, using linear search Print, if test score 90 was found and at what position Add Comments SEPARATE THE FILES INTO 3 : header.h, functions.cpp, main.cpp
Create a C++ program to : Prompt user for seven test score Store the scores into an array Print the array before and after sorting Print the test average Convert the average to letter grade Search for a test score 90, using linear search Print, if test score 90 was found and at what position Add Comments SEPARATE THE FILES INTO 3 : header.h, functions.cpp, main.cpp
This is for a grade and Is a Project for my Computer Programming Class using Microsoft Visual Studio C++ need to be able to copy code and copy output as well if you dont know how or what this is then please do not work on it Thank you. In this project you will Define a Robot class and command robot objects to move to different locations within an 10X10 grid (or board) to pickup and drop-off loads in different...
Write a program in C++ that uses a class template to create a
set of items.
. . The Problem Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 Hint: Use vectors and vector functions to store the set of...