1answer.
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
ipn [44]
3 years ago
14

Write statements that output variable numComputers as follows. End with a newline

Computers and Technology
1 answer:
gavmur [86]3 years ago
8 0

Complete Question:

Write statements that output variable numComputers as follows. End with a newline. There are 10 computers.

#include <iostream>

using namespace std;

int main()

{

int numComputers;

cin >> numComputers; // Program will be tested with values: 10.

...

return 0;

}

Answer:

cout << "There are ";

cout << numComputers;

cout << " computers." << "\n";

Explanation:

Using three cout statements the string "There are 10 computers." is printed out, notice that the variable numComputers is entered by the user when the program is run. Another way of concatenating an integer variable and string for printout is by the use of the + (plus) operator.

You might be interested in
If you need to add more data between column A and column B, you should _____. click in column A and paste a column click anywher
Luda [366]

Answer:

Use the insert column command by placing your cursor between A and B. Then insert your data

Explanation:

3 0
3 years ago
(01.01 LC)
zloy xaker [14]

Answer:

Create web and mobile applacations

Explanation:

6 0
2 years ago
Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the ra
Kazeer [188]

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

class Circle{

// private member variable named radius

private:

double radius;

// get function for radius

public:

double getRadius(){

return radius;

}

// set function for radius

void setRadius(double rad){

radius=rad;

}

// returning area = 3.14159 * radius * radius

double getArea(){

return (3.14159 * radius * radius);

}

};

// Sample run

int main()

{

// Declaring object of Circle

Circle myCircle;

myCircle.setRadius(5);

// printing radius of circle

cout<<"Radius of circle is: "<<(myCircle.getRadius())<<endl;

// printing area of circle

cout<<"Area of circle is: "<<(myCircle.getArea())<<endl;

return 0;

}

4 0
3 years ago
A teacher has five students who have taken four tests. The teacher uses the following grading scale to assign a letter grade to
AlladinOne [14]

Answer:

#include <iostream>

using namespace std;

int main()

{

const int numofStudents = 5;//number of students

const int numofTests = 2;//number of tests taken by students

const int grade = 5;//number of grades available

char letter[grade] = { 'A','B','C','D','F' };

double table[numofStudents][numofTests];//defining 2darray with names and scores

string names[numofStudents];//storing names of students

for (int num = 0; num < numofStudents; num++)//storing names and scores of students

{

 cout << "Enter student's name: ";

 cin >> names[num];

 for (int test = 0; test < numofTests; test++)//scores loop

 {

  cout << "Enter the test score: ";

  cin >> table[num][test];

  if (table[num][test] < 0 || table[num][test]>100)//input validation

  {

   cout << "Invalid input. Try again" << endl;

   cin >> table[num][test];//input again

  }

 }

}

for (int i = 0;i < numofStudents;i++)//calculating averages and grades

{

 int sum = 0;

 cout << "Test scores for " << names[i] << ": " << endl;

 for (int j = 0;j < numofTests;j++)

 {

  cout << table[i][j] << " ";

  sum += table[i][j];//summing scores

 }

 cout << endl;

 float average = (float)sum / numofTests;//calculating the average

 cout << "Making an average of: "<< average;

 if (average <= 100 && average >= 90)//assigning a grade

 {

  cout << " and has received an " << letter[0];

 }

 else if (average <= 89 && average >= 80)

 {

  cout << " and has received a " << letter[1];

 }

 else if (average <= 79 && average >= 70)

 {

  cout << " and has received a " << letter[2];

 }

 else if (average <= 69 && average >= 60)

 {

  cout << " and has received a " << letter[3];

 }

 else if (average <= 59 && average >= 0)

 {

  cout << " and has received an " << letter[4];

 }

 else

 {

  cout << "Invalid scores entered." << endl;

 }

 cout << endl;

}

 return 0;

}

Explanation:

We first define the number of students, number of tests and number of grades available for assignments. We then fill in the 2D array of students names and their scores making sure assigning more than 100 and less than 0 is not allowed. We then sum the scores and retrieve an average. Using the average, a letter grade is assigned to that individual.

6 0
3 years ago
Between which zones and a DMZ should firewalls be placed? Choose two answers.
brilliants [131]

Answer:

Internal and External Zones

Explanation:

Demilitarized Zone (DMZ) in a network means that, we make sure the security of network at higher level as military make sure the security of their bases or zones.

In this type of network, The network of the internal organization (LAN) needs security from hackers and unauthorized users who are trying to access the resources and information from the network.

This network is divided into two major zones. A DMZ has been placed between two zones along with firewalls enhance the security of LAN Network from the networks on internet. These two zones are named as Internal and External Zone. The firewall between DMZ and External zones monitors the users from external networks on the internet who tries to access organization's network. Internal network monitors the traffic between DMZ and Internal LAN network.

4 0
3 years ago
Other questions:
  • Which character must decide whether to support the assassins or avenge his friend's death?
    14·2 answers
  • What is the working principle of computer?
    9·1 answer
  • When changing the formatting of a spreadsheet to make it more readable, you should use light blue text on a bright blue backgrou
    12·1 answer
  • Explain why Windows and Linux implements multiple locking mechanisms. Describe the circumstances under which they use spinlocks,
    13·1 answer
  • Use the ________ method to write text to a web page.
    12·1 answer
  • I'm confused. Are , , and elements or nodes? What exactly defines nodes? What defines elements?
    13·1 answer
  • A tornado destroyed many
    6·2 answers
  • how to create use an array of Course objects instead of individual objects like course 1, course 2, etc
    11·1 answer
  • Compared with traditional methods, the entire rapid application development (RAD) process is expanded and, as a result, the new
    11·1 answer
  • Tips for staying safe using social media. Using in your own words.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!