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
agasfer [191]
3 years ago
12

Write the C++ statement to declare and initialize a 5-element, one-dimensional integer array named grades. Use the following gra

des to initialize the array: 100 90 80 78 98. Then write the C++ code to display the contents of the array on the screen using a 'for" loop.
Computers and Technology
1 answer:
wolverine [178]3 years ago
4 0

Answer:

int grades[5] = { 100, 90, 80, 78, 98 };

for(int i=0;i<5; i++)

{

  cout << grades[i];

}

You might be interested in
The _ are the devices that allow a computer system to communicate and interact with the outside world as well as store informati
padilas [110]

Answer:

I think the answer is the central processing unit. Hope it helps!!!!!

5 0
3 years ago
How are mathematics and computer science similar? Discuss any connections between numbers, logic, and other elements.
tester [92]

Answer:

Explanation:

Both mathematics and computer science use variables and logic in order to analyze, explain, and model real-world problems. Also mathematics is a very important part of computer science as the logic and algorithms in computer science require mathematics in order to device systems to solve these problems. For example, data structures in computer science require lots of linear algebra in order to traverse large data collections efficiently, while Artificial Intelligence would need calculus and linear algebra in order for it to be efficient.

7 0
2 years ago
If your computer will not turn on, what is something you would do to diagnose the problem?
laiz [17]

I would hold down the power button for about 10 seconds, and then try pressing the power button again.

If you are using a desktop, try unplugging it and then plugging it and plugging it back in again. Then try pressing the power button again. If this does not work, then unplug your computer again, but now plug in something else into the same spot, like a lamp, or a phone charger, and see if they work. If they do not work, then it is the power outlet that is broken, not your computer. If they do work, then there is most likely something wrong with your computer or your power cord. Try powering on your computer using a different power cord. If this does not work, you should take your computer some where to get it checked, and fixed, if necessary.

If you are using a laptop, try charging it, and then hold down the power button for about 10 seconds, and then try pressing the power button again. if this does not work, you should take your computer some where to get it checked, and fixed, if necessary.

8 0
3 years ago
George has to present the goals of information management to his team member. What is a goal of information management? The goal
Law Incorporation [45]

Answer:

The purpose of information management is to: design, develop, manage, and use information with insight and innovation. support decision making and create value for individuals, organizations, communities, and societies.

Explanation:

5 0
3 years ago
Write a C program to prform simple C aritlimetic calculations. The user is to enter a simple expression(integer operaior integer
larisa86 [58]

Answer:

Here is the C program:

#include <stdio.h>  //to use input output functions

//functions prototype

unsigned int mod(unsigned int a, unsigned int b);  

unsigned int mul(unsigned int a, unsigned int b);  

unsigned int sub( unsigned int a,unsigned int b);

float divide(unsigned int a,unsigned int b);  

unsigned int add( unsigned int a,unsigned int b);  

int main()  {  //start of main method

unsigned int a, b;   //declare variables to store the operands

char d;  //declare variable to store the operator

printf("Enter an operator:  ");   //prompts user to enter an operator

scanf("%c",&d);  //reads the operator from use

getchar();  //gets a character

while (d!='q')   { //keeps iterating until user enters q to quit

printf("Enter 1st operand: ");   //prompts user to enter first operand

scanf("%d",&a);   //reads first operand from user

getchar();  //reads character

printf("Enter 2nd operand: ");   //prompts user to enter second operand

scanf("%d",&b);   //reads second operand from user

getchar();  

if (d=='%')  {   //if the character of operator is a mod

printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = ");  //displays =

mod(a,b);  }  //displays computed modulo of two input operands

if (d=='*')   //if the input character is for multiplication operator

{printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = ");  //displays =

mul(a,b); }  //displays computed multiplication

if (d=='+')  {  //if the input character is for addition operator

printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = "); // displays =

add(a,b);  }   //displays computed addition

if (d=='/')  {  //if the input character is for division operator

printf("%d",a); // prints operand 1

putchar(d);  //displays operator

printf("%d",b);  //displays operand 2

printf(" = ");  //displays =

divide(a,b);  }   //displays computed division

if (d=='-')  {  //if the input character is for subtraction operator

printf("%d",a);  //prints operand 1

putchar(d);  //displays operator

printf("%d",b); // displays operand 2

printf(" = ");  //displays =

sub(a,b);  }  //displays computed subtraction

printf("Enter an operator: ");   //asks again to enter an operator

scanf("%c",&d);  //reads operator from user

getchar();  }  }   //gets character

unsigned int mod( unsigned int a, unsigned int b){  //function to compute modulo of two integers with no sign

     int c = a%b;  //computes mod

    printf("%d",c);  }  //displays mod result

unsigned int add(unsigned int a, unsigned int b){     // function to compute addition of two integers

    int c = a+b; //computes addition

    printf("%d\n",c);  } //displays result of addition

unsigned int mul(unsigned int a, unsigned int b){       //function to compute multiplication of two integers

    int c = a*b;  //multiplies two integers

   printf("%d\n",c); }  //displays result of multiplication

float divide(unsigned int a, unsigned int b){   //function to compute division of two integers

    float c = a/b;  //divides two integers and stores result in floating point variable c

    printf("%f\n",c);  } //displays result of division

unsigned int sub(unsigned int a, unsigned int b){       //function to compute subtraction of two integers

    int c = a-b;  //subtracts two integers

    printf("%d\n",c);  }  //displays result of subtraction

Explanation:

The program is well explained in the comments mentioned with each line of the program. The program uses while loop that keeps asking user to select an operator and two operands to perform arithmetic calculations. The if conditions are used to check what arithmetic calculation is to be performed based on user choice of operand and calls the relevant function to perform calculation. There are five functions that perform addition, modulo, subtraction, division and multiplication and display the result of computation. The screenshot of output is attached.

4 0
3 years ago
Other questions:
  • Which key removes all data from an active cell with one click
    7·2 answers
  • What is the last step in conducting url search
    11·1 answer
  • 3. You are a network administrator responsible for all network platforms and services. The Teta Company currently has only one b
    13·2 answers
  • A(n) ________ CPU has two processing paths, allowing it to process more than one instruction at a time.
    9·2 answers
  • Where (what memory location) is the data read from for the following code:
    12·1 answer
  • Implement a class Product. A product has a name and a price, for example new Product("Toaster", 29.95). Supply methods getName,
    14·2 answers
  • Giving Brainliest IFFF CORRECT
    9·1 answer
  • Interactive sites where users write about personal topic and comment to threaded discussion are called?
    10·2 answers
  • Write an assembly subroutine that check if a number is in the interval of [0, 10] and return 1 if the number is in this interval
    6·1 answer
  • 1. Define the term M.A.N.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!