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]
2 years ago
14

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

Computers and Technology
1 answer:
gavmur [86]2 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
You need a version of usb technology that will support older usb devices, of which you have many, as well as newer ones. what wo
tiny-mole [99]
The answer you're looking for might be "backwards-compatible".
7 0
3 years ago
Different uses of quick access toolbar
zhannawk [14.2K]
“The Quick Access Toolbar provides access to frequently used commands, and the option to customize the toolbar with the commands that you use most often. By default, the New, Open, Save, Quick Print, Run, Cut, Copy, Paste, Undo, and Redo buttons appear on the Quick Access Toolbar” -Information Builders
5 0
3 years ago
In Java.Use a single for loop to output odd numbers, even numbers, and an arithmetic function of an odd and even number. Use the
rosijanka [135]

Answer:

<em>This program is written using java programming language</em>

<em>Difficult lines are explained using comments (See Attachment for Source file)</em>

<em>Program starts here</em>

import java.util.*;

import java.lang.Math;

public class oddeven{

public static void main(String [] args)

{

 double even,odd;//Declare variables even and odd as double

 //The next iteration prints odd numbers

 for(int i = 1;i<=173;i+=2)

 {

  odd = i;

  System.out.format("%.4f",odd);//Round to 4 decimal places and print

System.out.print("\t");

 }

 System.out.print('\n');//Start printing on a new line

 //The next iteration prints even numbers

 for(int i = 0;i<=173;i+=2)

 {

  even=i;

  System.out.format("%.4f",even);//Round to 4 decimal places and print

System.out.print("\t");

 }

 System.out.print('\n');//Start printing on a new line

 double  ssqrt;//Declare ssqrt to calculate the square root of sum of even and odd numbers

 for(int i = 0;i<=173;i+=2)

 {

  ssqrt = Math.sqrt(2*i+1);//Calculate square root here

  System.out.format("%.4f",ssqrt); //Round to 4 decimal places and print

System.out.print("\t");

 }

}

}

Explanation:

Libraries are imported into the program

import java.util.*;

import java.lang.Math;

The following line declares variables even and odd as double

double even,odd;

The following iteration is used to print odd numbers  with in the range of 0 to 173

for(int i = 1;i<=173;i+=2)  {

odd = i;

System.out.format("%.4f",odd); This particular line rounds up each odd numbers to 4 decimal places before printing them

System.out.print("\t"); This line prints a tab

}

The following code is used to start printing on a new line

System.out.print('\n');

The following iteration is used to print even numbers  with in the range of 0 to 173

for(int i = 0;i<=173;i+=2)

{

even=i;

System.out.format("%.4f",even); This particular line rounds up each even numbers to 4 decimal places before printing them

System.out.print("\t"); This line prints a tab

}

The following code is used to start printing on a new line

System.out.print('\n');

The next statement declares ssqrt as double to calculate the square root of the sum of even and odd numbers

double  ssqrt;

for(int i = 0;i<=173;i+=2)

{

ssqrt = Math.sqrt(2*i+1);This line calculates the square root of sum of even and odd numbers

System.out.format("%.4f",ssqrt); This particular line rounds up each even numbers to 4 decimal places before printing them

System.out.print("\t"); This line prints a tab

}

Download java
7 0
3 years ago
Which AWS service is a managed service that makes it easy to set up, operate, and scale a relational database in the cloud?​
vaieri [72.5K]

Answer:

I use Google cloud free tier for my Minecraft server

4 0
3 years ago
In what Career Cluster you get to design, build, and destroy things
vaieri [72.5K]

Answer: Architecture

Explanation:

A career cluster can be defined as the group of careers in which professionals are related to common features or occupational tasks are related based on the common features. One person in a career cluster may like more than one job profiles in the same career cluster.

In architecture a person may like to design, build and destroy things to redesign them again. This involves knowledge, skills, mental and physical labor. Building and road constructions are the tasks performed by the architectures.

7 0
2 years ago
Other questions:
  • Trevor got home from work and suddenly realized that he needed to edit a certain file stored in the company network's server. ho
    11·1 answer
  • When creating an input/ output table, where do you enter the formula?
    5·1 answer
  • Page orientation can be either landscape or _____.
    13·1 answer
  • John would like to move from the suburbs into the city, but the rent in the city is very high. John has found an apartment he re
    13·1 answer
  • After saving her presentation initially, Leah realizes she needs to add another content slide. She adds the slide and is ready t
    7·1 answer
  • The difference between a want and a need is a want is not necessary for survival. Things necessary for survival are known as ___
    6·1 answer
  • For some reason, Danica's classmate George could not find the registered symbol in the symbol gallery. He is selling
    14·1 answer
  • Michael needs to ensure that those items that are automatically archived are still easily accessible within Outlook. Which optio
    7·2 answers
  • What year did polaroid introduce one-step photography with the SX-70
    14·1 answer
  • In 1868 the qwerty keyboard was patented by this man
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!