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
natali 33 [55]
3 years ago
15

Write the following program in C++ to print:

Computers and Technology
1 answer:
Alenkinab [10]3 years ago
4 0
1.
#include <iostream>#include <string>
using namespace std;
int main(){    string chars; // This is where we will put our @ signs and print them    for(int x=0;x < 5; x++){
        chars = chars + '@'; // This will concatenate an @ sign at the end of the variable        cout << chars << "\n";    }}

2.
#include <iostream>#include <string>
using namespace std;
int main(){    string name; // Our variable to store the name    cout << "What is your name? \n"; // Asks the user for their name    cin >> name;    cout << "\nWell, hello " << name << "!";}

3.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n"; // Asks for a number    cin >> number;    cout << "You entered " << number << "%!";}

4.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n";    cin >> number;
    int check = number % 2; // The modulo operator (the percent sign) gets the remainder of the quotient    if (check == 0) {        cout << number << " is even!"; // If the remainder is 0 then it prints out "x is even"    } else {        cout << number << " is odd!"; // If the remainder is not 0 then it prints out "x is odd"    }}

5.
#include <iostream>#include <string>
using namespace std;
int main(){    float r; // Our variable    cout << "Enter a radius\n";    cin >> r;    if (r < 0){        cout << "Lol. No."; // If the radius is less than zero print out that message    }    float circumference=2*3.14*r;    float area=r*r*3.14;    cout << "\n\n Circumference of circle: " << circumference;    cout << "\n Area of circle: " << area;}
You might be interested in
Which of the following is a non timber forest product
Ronch [10]
The word youre looking for is turpentine, because you don't need to cut down the tree to collect or make it.
5 0
2 years ago
During her presentation, Marie wanted more freedom to move about the room and interact with her audience. She can use _____.
S_A_V [24]

Answer:

The correct answer is:

"a laser pointer and a remote control"

Explanation:

Let us look at the options one by one.

notes pages and an LCD projector

When she is using these options, she cannot have the freedom to move as she has to operate the projector somehow.

laptop computer and a pointer

In this case she has to operate laptop so movement will be reduced.

<u>A laser pointer and remote control</u> will give her a lot of freedom to move as she can use the remote control to operate the slides and the pointer to point stuff ont the slides.

Hence,

The correct answer is:

"a laser pointer and a remote control"

5 0
3 years ago
I need Help!!<br> 4. Explain the importance of including negative space as part of a design.
vova2212 [387]
Negative space is the space between, within and surrounding an object in an image. The positive space is the focus of the image, the object itself, but the negative space is just as important. It shares edges with the positive space, defining the outline of the object and creating proportion
5 0
3 years ago
Have you ever watched Full House? Who is your favorite character and why? EXPLAIN AND ILL GIVE BRAINLIEST!
liubo4ka [24]

Answer:

havent watched it and thanks for this

Explanation:

7 0
2 years ago
Write a program to define three variables to hold three test scores. The program should ask the user to enter three test scores
Elza [17]

Answer:  

It's always good to use if else with boolean expressions in such cases.

Explanation:

I have written a program  where I have used c# as programming language.

I used if else block with boolean expressions to enforce conditions to print the grades according to the average of test scores. I have used Logical And(&&) operator in boolean expressions so that all the conditions in if and if else  must be true

Here is the program:  

using System;

public class Test

{

   public static void Main()

   {

       int testScore1, testScore2, testScore3;

       Console.WriteLine("enter first testScore");

       testScore1 = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine("enter second testScore");

       testScore2 = Convert.ToInt32(Console.ReadLine());

       Console.WriteLine("enter third testScore");

       testScore3 = Convert.ToInt32(Console.ReadLine());

       float avg = (testScore1 + testScore2 + testScore3) / 3;

       if(avg>=90)

       {

           Console.WriteLine("You got grade A");

       }

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

       {

           Console.WriteLine("You got grade B");

       }

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

       {

           Console.WriteLine("You got grade c");

       }

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

       {

           Console.WriteLine("You got grade D");

       }

       else if(avg< 60)

       {

           Console.WriteLine("You got grade E");

       }

       else

       {

           Console.WriteLine("Sorry, You failed");

       }

       Console.ReadLine();

   }    

}

Explanation of program:  

I created three variables named, testScore1, testScore2, testScore3 of datatype int. I prompted the user to enter three test score values. Each value is read using Console.ReadLine() . As the value entered is of type integer, I converted the  console read value into int using Convert method.  

In the next step, I calculated average using the formula.  

Now, Based on the average, I can calculate the grade according to the given grading scheme.

7 0
3 years ago
Other questions:
  • ________ hackers break into systems for non-malicious reasons such as to test system security vulnerabilities. black-hat gray-ha
    10·1 answer
  • Your friend Kayla is starting her own business and asks you whether she should set it up as a P2P network or as a client-server
    13·1 answer
  • .Although SQL is a language, you don’t use it to write applications? (true, false)
    8·1 answer
  • Which of the following function headings arevalid? If they are invalid, explain why.
    12·1 answer
  • What is the orbit? Define
    12·1 answer
  • Superclass in python explanation
    7·1 answer
  • Which type of software is used for marketing research as a way to find out about users' preferences?
    12·1 answer
  • What is the scope of numC?
    8·2 answers
  • 1. You are given a database to create, however, you realize that in the instructions you are told to create relationships betwee
    5·1 answer
  • an engineer is writing a web application that requires some user input. the engineer has put a submit button on their page and n
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!