[20 marks] (TestRobot.java) Design a class named Robot. The Robot class has three private data fields: position x, position y, and the direction (east, south, west, and north). Assume that positive x points to the east and positive y points to the south, and initially x = 0, y = 0, direction = "east".
Create a no-arg constructor and another constructor which sets the three data fields. Create the accessors and mutators for the three data fields.
Create a method named forward that moves the robot along the current direction for the given distance. For example, if the robot is currently facing east, forward(10) will move the robot along the positive x direction for 10 pixels.
In the main method, create a Robot object, move it to the east for 20 pixels, then set the direction to north and move 30 pixels, and finally set the direction to west and move 40 pixels. Find and display the final x and y values and the direction of robot by calling its methods. For example, for the sample testing above, your program should display x = -20, y = -30, and direction = west.
In: Computer Science
Hi, could you please expand on this code to include: Total earnings per division (East, West, North and south); Highest and lowest per division (East, West, North and South) and total earning for the entire company. Thank you so very much! Lab12B.cpp ========= #include #include using namespace std; //program to prompt user for sales of any division in any quarter and save to binary file struct Division { char name; //values could be N, E , W or S int quarter; //values could be 1, 2, 3, 4 double sales; }; int main() { ifstream inFile("divisions.dat", ios::in | ios::binary); string ans = "y"; Division div; if(inFile.fail()) { cout << "Could not open divisions.dat for reading. Please use Lab12A to create the file" << endl; return 0; } cout << "Reading data from divisions.dat" << endl; inFile.read(reinterpret_cast(&div), sizeof(div)); while(!inFile.eof()) { cout << "Division name: " << div.name << endl; cout << "Quarter No.: " << div.quarter << endl; cout << "Sales amount: " << div.sales << endl << endl; inFile.read(reinterpret_cast(&div), sizeof(div)); } inFile.close(); }
In: Computer Science
1. Among western scholars, democracy is a key element in the transition of the Third World from poverty to prosperity. China is not a democracy, but it has lifted millions out of poverty, and has recorded high levels of economic growth. China is also not an inclusive society, nor does it demonstrate democratic accountability. Discuss what you believe to be responsible for the prosperity of China, in spite of its resistance to prescribed
Western methods of social and economic transformation.
2. The COVID-19 pandemic has been ravaging the major global economies. According to the government of China the disease has been contained enough for populations in some areas to return to work. In the U.S. the virus has not yet reached its peak, and the economy is in imminent danger of a recession. Given what you now know about the Third world, discuss what you consider the three most likely outcomes of COVID-19 in countries such as South Africa, India and Brazil.
3. Identify and discuss the three most significant aspects of this course, which have shaped, challenged and or confirmed your views of the Global South. Please provide examples where appropriate.
thorough answers help ! ty!!
In: Economics
You are saving up to retire early. You plan to deposit $195 every week for 20 years. If you think you can earn 8% per year on average, how much will you have in 20 years?
In: Finance
If the US economy was growing at a rate of 2 percent or better in mid-1992, how is it possible that unemployment was rising?
Please explain the specifics of the economy in the early to mid-1990s which caused unemployment to grow. Please be concrete, I will rate
In: Economics
1. What are the three romantic attachment styles described by Shaver and colleagues?
2. Briefly describe one, and give an example of how it might ‘look.’
3. How are these similar to early attachment styles described by researchers such as Bowlby and Ainsworth?
In: Psychology
In early 2011, political revolution started in many Middle Eastern and African countries. Discuss the actual, probable and potential effects of the political turmoil on MNCs that operate in these countries. Specifically, describe the risk MNCs face while operating in these countries.
In: Finance
Self-concept is generally established early in life, but is modified through social roles and life experiences. Discuss some experiences of the later years that may alter an older person’s self-concept and may negatively influence their self-esteem
In: Psychology
Estimate the initial rotation period of the Earth if the Moon had been torn from it, as suggested by the fission theory. Compare your answer to the estimated rate of spin of the early Earth (5 hours or so). Is the fission theory a viable theory?
In: Physics
1,What is the worst possible/most likely complication(s) to Impaired gas exchange related to Covid-19
List 3 on each
Nursing Interventions to PREVENT this Complication:
Assessments to Identify Problem EARLY:
Nursing Interventions to Rescue:
In: Nursing