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

Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can

cover 350.0 square feet. So gallons = the square feet divided by 350.0. If the input is 250.0, the output should be:
0.714285714286
Computers and Technology
1 answer:
Zepler [3.9K]2 years ago
4 0

Answer:

The program in Python is:

Area = float(input("Area: "))

print("Gallons: "+str(Area/350.0))

Explanation:

The requirement of the program is straightforward and what is required is to divide the inputted area by 350.

Hence, the explanation is as follows:

This line prompts user for Area

Area = float(input("Area: "))

This line calculates and prints the equivalent number of gallons

print("Gallons: "+str(Area/350.0))

You might be interested in
Which type of formatting would you apply to spreadsheet data so that each cell is outlined?
rjkz [21]

Answer:

D. Border

Explanation:

Edge 2020

5 0
2 years ago
What term is used to describe the average amount of time that will pass for a device before a failure is expected to occur?
sleet_krkn [62]
A mean is another word for average (kind of)
7 0
2 years ago
A computer that passes the Turing test might show that
kow [346]
A computer that passes the Turing test might show that has the ability to exhibit intelligence similar to, or indistinguishable from that of a human.
8 0
3 years ago
3. (20 points) Write a C++ recursive function that finds the maximum value in an array (or vector) of integers without using any
Luden [163]

Answer:

Following are the code to this question:

In option (i):

#include <iostream>//defining header file

using namespace std;

int findMax(int B[], int x)//defining recursive method findMax

{

if (x == 1)//defining condition when value of n==1

return B[0];//return array first element

return max(B[x-1], findMax(B, x-1)); // calling recursive method inside max method and return value

}

int main() //defining main method  

{

int B[] = {12, 24, 55, 60, 50, 30, 29};//defining array B

int x= 7;//defining integer variable and assign a value

cout << "Maximum element value of the array is: "<<findMax(B, x)<<endl;//calling method findMax and print value

return 0;

}

Output:

Maximum element value of the array is: 60

In option (ii):

\Rightarrow \ T(n) = 1 + T(n-1)\\\Rightarrow  1 + 1 + T(n-2)\\ \Rightarrow  1 + 1 + 1 + ... n \ times \\\Rightarrow  O(n) \\

Explanation:

In the above-given program a recursive method "findMax" is defined, which accepts an array "B" and an integer variable "n" in its parameter, inside the method a conditional statement is used that, checks value of x equal to 1.

  • If the above condition is true it will return the first element of the array and find the max number.
  • Inside the main method, an array B is declared that assigns some values and an integer variable is declared, that also assigns some values, in the last step print method is used that pass value in method and prints its return value.
  • In the option (ii) we calculate the Big-O notation algorithm value.
5 0
3 years ago
Write a recursive method, numToString, that takes two arguments: num, the number to convert, and base, the base to represent the
AnnyKZ [126]

Answer:

This is the required code:

Explanation:

public class NumberToString {

   public static String numToString(int num, int base) {

       final String digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

       if (num < base) {

           return "" + digits.charAt(num);

       } else {

           return numToString(num / base, base) + digits.charAt(num % base);

       }

   }

}

6 0
3 years ago
Other questions:
  • Why are computer programs so much longer now than they were in the late 1980?
    8·1 answer
  • Which of the following is not a valid FICO Credit score?
    12·2 answers
  • Which of the following are examples of the concept of layered access in physical security? Select one: a. Firewall, IDS, CCTV b.
    11·2 answers
  • Who owns the internet? <br><br> A.) Nobody<br> B.) W3C<br> C.) NSCA<br> D.) The US Military
    7·1 answer
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    6·1 answer
  • Identify the hardware components in your own computer. If you don't have a computer, use a friend's, or one at work or in an NVC
    5·1 answer
  • what is cicada 3301? i will give brainliest if you give me a correct answer (not copy and pasted) and somewhat well detailed, i
    8·1 answer
  • (True or False) The speed at which data travels on a bus is referred to as the word size.
    6·2 answers
  • The Internet Protocol Suite consists of the Internet Protocol and _____. a. Transmission Control Protocol b. File Transfer Proto
    15·2 answers
  • 30 POINTS FOT THE ANSWER FAST
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!