The following code will not display the results expected by the programmer. Can you find the error? Declare Real lowest, highest, average Display "Enter the lowest score." Input lowest Display "Enter the highest score." Input highest Set average = low + high / 2 Display "The average is ", average, "."

Answers

Answer 1

Based on the information given, the first error in the code is that the Variable name is lowest, NOT low, and Set average = low + high / 2.

How to find the error in the code.

For Error 2: Variable name is highest, NOT high and Set average = low + high / 2

For Error 3 : Set average = low + high / 2. Thus, you will need to add the lowest and highest, then perform the division by 2

Set average = (lowest + highest) / 2 is the the correct statement.

Learn more about codes on:

https://brainly.com/question/25875879


Related Questions

Match the data type to the given data.
1. float
2. array
3. Boolean
4. character

false
с
c, o, m, p, u, t, er
26.2

Answers

Float: 26.2
Array: c, o, m, p, u, t, er
Boolean: false
Character: c

Write a C console application that will be used to determine if rectangular packages can fit inside one of a set of spheres. Your program will prompt the user for the three dimensions that define a rectangular box; the length, the width, and the height. The interior diameter of a sphere is used to identify its size. Spheres are available in the following five sizes: 4- inch, 6-inch, 8-inch, 10-inch, and 12-inch. Your program will execute repeatedly until the user enters a value of zero for one or more of the rectangular box dimensions. After obtaining the dimensions of the rectangular box, your program will call a function named getSphereSize that determines if the box will fit inside one of the five spheres. The formula for calculating the diagonal of a rectangular box is:

Answers

Answer:

#include <cmath>

#include <iostream>

using namespace std;

int getSphereSize(double length, double breadth, double height) {

   double diagonal = sqrt(length * length + breadth * breadth + height * height);

   if (diagonal <= 4)

       return 4;

   if (diagonal <= 6)

       return 6;

   if (diagonal <= 8)

       return 8;

   if (diagonal <= 10)

       return 10;

   if (diagonal <= 12)

       return 12;

   return 0;

}

int main() {

   double length, breadth, height;

   int sphereCounts[5] = {0};

   int sphereSize;

   while (true) {

       // Get dimensions of the box

       cout << "Enter the dimensions of the box:\n";

       cout << "Length: ";

       cin >> length;

       cout << "Breadth: ";

       cin >> breadth;

       cout << "Height: ";

       cin >> height;

       if (length <= 0 || breadth <= 0 || height <= 0)

           break;

       sphereSize = getSphereSize(length, breadth, height);

       if (sphereSize == 0)

           cout << "The box cannot fit in any of the spheres";

       else

           cout << "The box can fit in the " << sphereSize << "-inch sphere";

       // Increment the counter

       if (sphereSize == 4)

           sphereCounts[0]++;

       else if (sphereSize == 6)

           sphereCounts[1]++;

       else if (sphereSize == 8)

           sphereCounts[2]++;

       else if (sphereSize == 10)

           sphereCounts[3]++;

       else if (sphereSize == 12)

           sphereCounts[4]++;

       cout << "\n\n";

   }

   cout << "\nNumber of 4-inch spheres: " << sphereCounts[0];

   cout << "\nNumber of 6-inch spheres: " << sphereCounts[1];

   cout << "\nNumber of 8-inch spheres: " << sphereCounts[2];

   cout << "\nNumber of 10-inch spheres: " << sphereCounts[3];

   cout << "\nNumber of 12-inch spheres: " << sphereCounts[4];

   cout << endl;

   return 0;

}

Explanation:

The "cmath" library is included in the c++ program. The getSphereSize function is used to return the sphere size the rectangle dimension can fit into. It program continuously prompts the user for the length, breadth, and height of the rectangle and passes the values to the getSphereSize function in the while but breaks if any or all of the variable value is zero.

The sizes of the sphere objects in inches are collected in an array of five integer values of zeros and are incremented by one for every match with a rectangle.

Pls awnser I will mark brainliest math

Answers

It’s 34....!!!! i did this before

Answer:

2788 or 116

Explanation:

of what is famous Ted Nelson?​

Answers

Answer:

Nelson proposed a system where copying and linking any text excerpt, image or form was possible.

Explanation:

Ted Nelson is one of the theoretical pioneers of the world wide web who is best known for inventing the concept of hypertext and hypermedia in the 1960s. As one of the early theorists on how a networked world would work.

How I know:

I goggle it.

Other Questions
THIS IS THE LAST ONE I NEED HELP ONNNN!!! Water is a renewable resource that is constantly generated through the water cycle. The ocean contains most of the Earth's available water, but it is undrinkable because it contains salt. All but one of the reasons listed are reasons why desalination is not a popular option to have clean, drinkable water. it is expensive to desalinate water. B It could possibly affect the marine ecosystems. Transporting the water to water scarce regions is difficult. D) Since evaporation is involved in deselination, the drinking water is too hot for consumption. 1 hr=3.6 10^3 seconds 1 day =24 hrs1 year =3.65 10^2daysuse scientific notation to calculate the number of seconds in 3 days 1. How is the structure of this (story once upon a time) similar to a fairy tale?What elements do they share? Cite details from the text to support youranalysis. please helpp!! please helpppppHow did the weapons of WW2 change the human cost of war? How do the key events of ww2 affected the outcome?How was ww2 different inland from the pacific? Historical context of the Lipton's tea gardens On graph paper, draw diagrams of a+a+a+a and 4a when a is 1, 2, and 3. What do you notice? Can someone help me out Im marking brainliest if correct! Tim has completed five math problems and 13 minutes if he continues at the same rate how long will it take him to finish 20 problems 8. How does LaDue's autism impact the way the police officersperceive him?(Paragraph 58-60)A. His lack of eye contact with officers made them not trust himand the information he revealed to them.B.His lack of emotion and straightforward way of answeringquestions made him appear cold and calculated.C. His unpredictable anger at the perception that he was notsmart about incendiary devices made him seem volatile to thepoliceD. His obsession with bloodshed lowered his threshold towardsviolence, making the officers believe he would have followedthrough Animal use chlorophyll to produce glucose.True False Please do number 16 for me. Mason use of a gram of honey to make 3/10 of a pan of pudding. How many grams of honey are needed to make a full pan of pudding? What responsibility goes along with the right to trial by jury? Responsibility to vote for jury members Responsibility to serve on a jury Responsibility to vote for Supreme Court justices Responsibility to pay taxes Can you please tell me the equation to solve for x ..................Help please! (5 + 7) = xIn word form Someone please help :( ????? HURRY PLEASEEEEThe Continental Divide and the Rocky Mountains are different landforms. T OR F please help me please i really need help please