answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kvv77 [185]
2 years ago
15

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

reeting script the robot can use later. Our first task is to use the following script to prototype the robot for presentation: (Robot) Computer: Hello, welcome to Montgomery College! My name is Nao. May I have your name? (Visitor) Human: Taylor (Robot) Computer: Nice to have you with us today, Taylor! Let me impress you with a small game. Give me the age of an important person or a pet to you. Please give me only a number! (Visitor) Human: 2 (Robot) Computer: You have entered 2. If this is for a person, the age can be expressed as 2 years or 24 months or about 720 days or about 17280 hours or about 1036800 minutes or about 62208000 seconds. If this is for a dog, it is 14 years old in human age If this is for a gold fish, it is 10 years old in human age (Robot) Computer: Let's play another game, Taylor. Give me a whole number (Visitor) Human: 4 (Robot) Computer: Very well. Give me another whole number (Visitor) Human: 5 (Robot) Computer: Using the operator +'in C++, the result of 4 + 5 is 9. Using the operator , the result of 4/5 is 0; however, the result of 4.0/5.0 is about 0.8 (Robot) Computer: Do you like the games, Taylor? If you do, you can learn more by taking our classes. If you don't, I am sad. You should talk to our Chairman! Write a program that uses the script above as a guide without roles, i.e. robot computer and visitor human, to prototype robot greeting in C++
Computers and Technology
1 answer:
artcher [175]2 years ago
4 0

Answer:

C++ code is explained below

Explanation:

#include <iostream>

#include <iomanip>

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;

}

You might be interested in
Alice is adding a chart in a spreadsheet. Which option will allow you her to give the chart a suitable title and subtitle?
Anon25 [30]

Chart elements is the answer.


8 0
2 years ago
Read 2 more answers
The budget process which emphasizes the achievement of goals and competition between alternatives is:
Maslowich

The question has multiple choices;


<span>A) </span>Incremental budgeting.
B) Performance budgeting.
C) Program budgeting.
D) Target based budgeting.


I’d say D is the answer; Target based budgeting


Target based budgeting focuses on the achievement of goals and competition. Prices in Target based budgeting are used as a tool to make or break sales. This method includes researching the markets to decide at what exact price a product will sell.






4 0
2 years ago
Consider the following code segment.
m_a_m_a [10]

Answer:

10 20                                                                                                                          

30 40                                                                                                                          

50 60

Explanation:

Given

The above code segment

Required

What is printed, if anything

To do this, we analyze the code line by line.

Line 1: The first line creates a 4 by 3 array named mat

Line 2: for (int[] row : mat) {  -> This creates row[] array which represents each row of array mat

Line 3: for (int j = 0; j < row.length; j += 2){ -> This iterates through the even indexed elements of the row array i.e. 0 and 2

Line 4: System.out.print(row[i] + " "); -> This prints the even indexed elements of the row array.

The even indexed elements are: 10, 20, 30, 40, 50 and 60

Line 5: System.out.println(); --> This prints a new line

8 0
2 years ago
In the range D5:D9 on all five worksheets, Gilberto wants to project next year's sales for each accessory, rounded up to zero de
Maksim231197 [3]

Answer:

Enter the following in D5:

=ROUNDUP((SUM(B5,B5)*C5),0)

Explanation:

Required

Add up B5 and B5, then multiply by C5.

Save result rounded up to 0 decimal places in D5

The required computation can be represented as:

D5 = (B5 + B5) * C5 <em>[Approximated to 0 decimal places]</em>

In Excel, the formula is:

=ROUNDUP((SUM(B5,B5)*C5),0)

Analyzing the above formula:

= ---> This begins all excel formulas

ROUNDUP( -> Rounds up the computation

(SUM(B5,B5) ---> Add B5 to B5

*C5) --> Multiply the above sum by C5

,0) ---> The computation is rounded up to 0 decimal places

To get the formula in D6 to D9, simply drag the formula from D5 down to D9.

The resulting formula will be:

=ROUNDUP((SUM(B6,B6)*C6),0)

=ROUNDUP((SUM(B7,B7)*C7),0)

=ROUNDUP((SUM(B8,B8)*C8),0)

=ROUNDUP((SUM(B9,B9)*C9),0)

8 0
1 year ago
____________ is defined as the set of activities that revolve around a new software product, from its inception to when the prod
Elis [28]

Answer:

The answer is Application Lifecycle Management

Explanation:

Application lifecycle management is the complete handling and management of computer software programs from inception till it is retired.

It covers various aspects like requirement gathering management; software architecture; software programming, testing, and maintenance; change management, with continuous integration, release management, upgrades, deployment and so-on.

Application Lifecycle Management is defined as the set of activities that revolve around a new software product, from its inception to when the product matures and perhaps retires

4 0
2 years ago
Other questions:
  • The adjusted cell references in a copied and pasted formula are called ____ cell references.
    7·1 answer
  • Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation
    6·1 answer
  • Consider the following method intended to modify the parameter names by removing all instances of the String n.
    14·1 answer
  • Your company just bought a new subsidiary based in Des Moines, Iowa. Although your local operation already uses IPv6 for local n
    7·1 answer
  • What will the output of this program be when it is executed? def test_function( length, width, height): print ("the area of the
    15·1 answer
  • Write a complete Java program that: Prompts an employee to enter the number of hours that they have worked in a given week and s
    14·1 answer
  • Write a method called printRangeOfNumbers that accepts a minimum, maximum numbers as parameters and prints each number from mini
    6·1 answer
  • First, open two separate terminal connections to the same machine, so that you can easily run something in one window and the ot
    8·1 answer
  • A record company is using blockchain to manage the ownership of their copyrighted content. The company requires that every time
    9·1 answer
  • I have a variable and set it equal to 5. 1 then send it as an argument to a function that adds 5 to the variable passed in. Outs
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!