Question

Include FlowChart as well.

The Department plans to purchase a humanoid robot. The Chairman would like you to write a program to show a greeting script the robot can use later. Your first task is to use the following script to prototype the robot for presentation:

Project Description The Department plans to purchase a humanoid robot. The Chairman would like you to write a program to show

 Write a program that uses the script above as a guide without roles, L.e. robot computer and visitor human, to prototype robot greeting in C++. See the Sample Screen Output below.

Project Specifications Input Visitors name .An age .Two numbers Output: The program should display the following data: Compl


5 0
Add a comment Improve this question Transcribed image text
Answer #1

C++ Code:

Output Snapshot:

Text Code:

#include
#include
using namespace std;

int main()
{
// Variables to store inputs
string robot_name = "Nao";
string visitor_name;
int age, first_num, second_num;
// Constant variable initialisation for programmer name
const string programmer_name = "XXXXXXXX";
// Constant variable initialisation for assignment number
const string assignment_num = "123546";
// Constant variable initialisation for due date
const string due_date = "16 August, 2019";
// Displaying robot's name as script
cout << "Hello, welcome to Montgornery College!";
cout << "My name is " << robot_name << " . May I have your name?" << "\n\n";
// Taking visitor's name as input from the visitor
cin >> visitor_name;
// Displaying vistor's name as script
cout << "\n\nNice to have your with us today, " << visitor_name << "! ";
cout << "Let me impress you with a small game.";
cout << "Give me the age of an important person or a pet to you. ";
cout << "Please give me only a number!" << "\n\n";
// Taking human age as input from the visitor
cin >> age;
// Displaying human's age as script
cout << "\n\nYou have entered " << age << ". If this is for a person,";
cout << " the age can be expressed as " << age << " years or ";
// Computing months, days, hours, minutes and seconds from age input
double months = age*12;
double days = months*30;
double hours = days*24;
double minutes = hours*60;
double seconds = minutes*60;
// Computing dogs and fish age from human's age
double dogs_age = 7*age;
double gold_fish_age = 5*age;
// Displaying months, hours, minutes, hours and seconds as script
cout << months << " months or about " << days << " days or";
cout << " about " << fixed << setprecision(0) << hours << " hours or about " << minutes;
cout << " or about " << fixed << setprecision(0) << seconds << " seconds. If this is for a dog.";
// Displaying dogs age and gold fish age as script
cout << " it is " << dogs_age << " years old in human age.";
cout << " If this is for a gold fish, it is " << gold_fish_age;
cout << " years old in human age" << "\n\n";
cout << "Let's play another game, " << visitor_name << "!";
cout << "Give me a whole number." << "\n\n";
// Taking first whole number from the visitor
cin >> first_num;
cout << "\nVery well. Give me another whole number." << "\n\n";
// Taking second whole number from the vistor
cin >> second_num;
// Computing sum and division for displaying in the script
double sum = first_num+second_num;
double division = first_num/second_num;
float floatDivision = (float)first_num/second_num;
// Displaying sum and division script
cout << "\nUsing the operator '+' in C++,";
cout << " the result of " << first_num << " + " << second_num;
cout << " is " << sum << ". Using the operator '/', the result ";
cout << "of " << first_num << " / " << second_num << " is " << division;
cout << "; however, the result of " << first_num << ".0 /" << second_num;
cout << ".0 is about " << floatDivision << "." << "\n\n";
cout << "Do you like the games, " << visitor_name << "?";
cout << " If you do, you can learn more by taking our classes.";
cout << ". If you don't, I am sad, You should talk to our Chairman!" << "\n\n";
// Displaying Programmer Name, Assignment Number and due date to output screen
cout << "Programmer Name : " << programmer_name << endl;
cout << "Assignment Number : " << assignment_num << endl;
cout << "Due Date : " << due_date << endl;
  
return 0;
}

Flowchart:

Explanation:

  • The program is written in the C++ programming language.
  • Please change the "XXXXXXX" as per your name in the code(Line number 20), before running the code.
  • The program mainly contains cin and cout functions for taking input from the visitor and displaying the output to the visitor as per the script.
  • Please refer code comments for the understanding purpose.
Add a comment
Know the answer?
Add Answer to:
The Department plans to purchase a humanoid robot. The Chairman would like you to write a program to show a greeting script the robot can use later.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1 Overview For this assignment you are required to write a Java program that plays (n,...

    1 Overview For this assignment you are required to write a Java program that plays (n, k)-tic-tac-toe; (n, k)-tic- tac-toe is played on a board of size n x n and to win the game a player needs to put k symbols on adjacent positions of the same row, column, or diagonal. The program will play against a human opponent. You will be given code for displaying the gameboard on the screen. 2 The Algorithm for Playing (n, k)-Tic-Tac-Toe The...

  • Case Study 1: Should a Computer Grade Your Essays? Would you like your college essays graded...

    Case Study 1: Should a Computer Grade Your Essays? Would you like your college essays graded by a computer? Well, you just might find that happening in your next course. In April 2013, EdX, a Harvard/MIT joint venture to develop massively open online courses (MOOCs), launched an essay-scoring program. Using arti ficial intelligence technology, essays and short answers are immediately scored and feedback tendered, allowing students to revise, resubmit, and improve their grade as many times as necessary. The non-profit...

  • please Identify the key points and main thesis of the article 2. Describe the skills you...

    please Identify the key points and main thesis of the article 2. Describe the skills you will need to develop to manage the hospital of the future. use critical analysis doing these questions Suggestion for writing assignmemnt make believe the reader has never read the article -what are the key points you would want the reader to know in order to understand the hospital of the future. In addition, managers, executives do not have time to read--so again what key...

  • Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of...

    Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of physician-centered and collaborative communication. How is the caregiver’s role different in each model? How is the patient’s role different? Answer: Physical-centered communication involves the specialists taking control of the conversation. They decide on the topics of discussion and when to end the process. The patient responds to the issues raised by the caregiver and acts accordingly. On the other hand, Collaborative communication involves a...

  • i have the case study question with the answers but i need help to re-write the...

    i have the case study question with the answers but i need help to re-write the answers. please see the attached files Case Study Analysis (CSF3003) Assessment Description and Requirements CLO1: Case Study 1 Ahmad lef home to study master and PhD in Australia. He has fees for the first semester only. After he arrived to Sydney and settled down, he start looking for a part-time job to save money for the next term. Ahmad has some experience on making...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

  • And there was a buy-sell arrangement which laid out the conditions under which either shareholder could...

    And there was a buy-sell arrangement which laid out the conditions under which either shareholder could buy out the other. Paul knew that this offer would strengthen his financial picture…but did he really want a partner?It was going to be a long night. read the case study above and answer this question what would you do if you were Paul with regards to financing, and why? ntroductloh Paul McTaggart sat at his desk. Behind him, the computer screen flickered with...

  • First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below...

    First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....

  • Case: Enron: Questionable Accounting Leads to CollapseIntroductionOnce upon a time, there was a gleaming...

    Case: Enron: Questionable Accounting Leads to CollapseIntroductionOnce upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant “E,” slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm laid off 4,000...

  • CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a...

    CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant "E" slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT