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
frutty [35]
3 years ago
8

LAB:

Computers and Technology
1 answer:
Sergeu [11.5K]3 years ago
3 0

Answer:

Following is the program in the C language

#include <stdio.h> // header file  

int main() // main function

{

float weight1[10]; // array declaration  

float sum=0,max1,t; // variable declaration

for(int k = 0; k < 5; k++) //iterating the loop

{

printf("Enter weight %d: ",k+1);

scanf("%f",&weight1[k]); // Read the array by user

}

printf("\n");

printf("You entered: ");

max1=weight1[0];

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

{

sum=sum+weight1[k];

if(max1 < weight1[k]) // check condition for highest element

{

max1=weight1[k];

}

printf("%.2lf ",weight1[k]);

}

t=sum/5.0; // find average

printf("\nTotal weight: %.2lf\n",sum); // displat total

printf("Average weight: %.2lf\n",t); // display Average

printf("Max weight: %.2lf\n",max1); // display maximum value

return 0;

}

Output:

Enter weight 1: 1

Enter weight 2: 2

Enter weight 3:3

Enter weight 4:4

Enter weight 5: 5

You entered:  1.00  2.00  3.00  4.00  5.00

Total weight: 15.00

Average weight:  3.00

Max weight:  5.00

Explanation:

Following are description of program :

  • Declared a array "weight1" of type "float" .
  • Declared a variable sum,t max1 of type "float ".
  • Iterating the loop for taking the input by the user by using scanf statement .
  • Iterating the loop for calculating the maximum value in "max1" variable  ,total in "sum" variable .
  • In the "t" variable we calculated the average.
  • Finally we print the value of the maximum ,average ,total and respective array that are mention in the question .

You might be interested in
When gathering information, which of the following tasks might you need to
azamat
I think it would be B but I’m not entirely sure.
7 0
3 years ago
The part of a rocket engine that allows the combustion gases and flames to leave the rocket engine is the
coldgirl [10]
That would be A: Nozzle
6 0
3 years ago
14. Which commercial RDBMS product was the first to hit the market and is the biggest?
schepotkina [342]

The answer is definitely (A. SQL server) it was released back in 2010 and is huge!

Let us know if there is anything else you need to know.

Mark brainlest :)

3 0
3 years ago
Write, compile and test (show your test runs!) program that calculates and returns the fourth root of the number 81, which is 3.
lys-0071 [83]

Answer:

I am writing a JAVA program. Let me know if you want the program in some other programming language.

public class FourthRoot{ //class to calculate fourth root of 81

public static void main(String[] args) { //start of main() function body

   double square_root; //declares to hold the fourth root of 81

   double number=81; // number is assigned the value 81

/* calculates the fourth root of number using sqrt() method twice which means sqrt() of sqrt(). This is equivalent to pow(number,(0.25)) where pow is power function that computes the fourth root by raising the number 81 to the power of 0.25 which is 1/4 */

   square_root=Math.sqrt(Math.sqrt(number));

//displays the fourth root of 81 i.e. 3

     System.out.println("Fourth Root of 81 is "+ square_root); } }

Explanation:

The program is well explained in the comments given along with each statement of the program . Since it was the requirement of the program to user Math.sqrt() method so the fourth root of number= 81 is computed by taking the sqrt() of 81 twice which results in the fourth root of 81 which is 3.

So the first sqrt(81) is 9 and then the sqrt() of the result is taken again to get the fourth root of 81. So sqrt(9) gives 3. So the result of these two computations is stored in square_root variable and the last print statement displays this value of square_root i.e. the fourth root of number=81 which is 3.

Another way to implement the program is to first take sqrt(81) and store the result in a variable i.e. square_root. After this, again take the sqrt() of the result previously computed and display the final result.

public class FourthRoot{

   public static void main(String[] args) {

   double square_root;

   double number=81;

   square_root=Math.sqrt(number);

  System.out.println("Fourth Root of 81 is: "+ Math.sqrt(square_root)); } }

The program along with its output is attached in a screenshot.

5 0
4 years ago
Does anyone have any tips on how to begin a 10 page Capstone project paper? I've got to write a write a research paper on the ty
Stella [2.4K]

Answer:

first resherch what you will be doing on the job and maybe what training you will need and what school you will have to go to it might also help to include what pay you would get and how many hours you will do

Explanation:

sorry its not much but i hope this helps

8 0
2 years ago
Read 2 more answers
Other questions:
  • Whoevr answers this will be marked brainliest
    12·1 answer
  • Chris needs to modify the default bullets that are used in a nonnumbered list in word. Which method should he use?
    9·2 answers
  • If you had a chance to see what your life would be like in 20 years
    8·1 answer
  • Why when i create a powerpoint on word it doesn't open properly in other programmes
    5·1 answer
  • What are computer virus ? Explain in detail.In your answer include symptoms and prevention (3each)
    10·1 answer
  • Determine whether the phrase below is a sentence or a fragment.
    12·1 answer
  • Why is it important to think about the programming language to use?
    8·1 answer
  • 1. Choose a real or made up company, and describe at least three ways in which the company uses technology. (1-3 sentences. 3.0
    13·1 answer
  • What is the grade, as a percentage with two digits after the decimal point, obtained when you graded this 101-question multiple-
    13·1 answer
  • During the post process,the Bios uses two different ways to notify you of a problem. Error beep codes and error messages .Explai
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!