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
RSB [31]
3 years ago
14

Create two functions (with appropriate names) that produce the output below. Both functions must use a prototype. All that shoul

d be present in main() is the call to these two functions and a blank line of output between the function calls. This is a very easy exercise. Focus on the fundamentals. Make sure you review my solution file to make sure your syntax and name choice is good. Output: This is the first part of my program. It was created with a function. <-- These two lines are output by the first function This is the second part of my program. It was created with a different function. <-- These two lines are output by the second function
Computers and Technology
1 answer:
Mariulka [41]3 years ago
3 0

Answer:

In C++:

#include <iostream>

using namespace std;

void function1(); void function2();

int main(){

   function1();    function2();

   return 0;}

void function1(){

   cout<<"This is the first part of my program."<<endl<<"It was created with a function"<<endl;}

void function2(){

   cout<<"This is the second part of my program."<<endl<<"It was created with a different function.";}

Explanation:

This defines the function prototypes

void function1(); void function2();

The main begins here

int main(){

This calls the two functions from main

   function1();    function2();

   return 0;}

This calls function1()

<em>void function1(){</em>

<em>    cout<<"This is the first part of my program."<<endl<<"It was created with a function"<<endl;}</em>

This calls function2()

<em>void function2(){</em>

<em>    cout<<"This is the second part of my program."<<endl<<"It was created with a different function.";}</em>

You might be interested in
You have a server called server1 that is running windows server 2012. what command would you use to delete the ptr record for 10
dybincka [34]
You could use th dnscmd server1 /recorddelete command that would allow you to delete record through powershell
3 0
3 years ago
What computer is designed for particular application​
Karo-lina-s [1.5K]

Answer: Applications for desktop or laptop computers are sometimes called desktop applications, while those for mobile devices are called mobile apps. When you open an application, it runs inside the operating system until you close it

Explanation:

5 0
2 years ago
The extent to which a program satisfies its specificationand fulfills the customer’s mission objectives is said to beachieving t
GuDViN [60]

Answer:

b) Reliability.

Explanation:

When the program gives correct output and fulfills the customer's requirements it is said to be reliable and said to be achieving reliability.

Correctness is when the program only provides correct solution.

Efficiency is when the program does the work in less time.

Usability means that the program is usable or not.

5 0
3 years ago
Extend to also calculate and output the number of 1 gallon cans needed to paint the wal. Hint: Use a math function to round up t
Crank

Answer:

Here is the Python program:

import math #import math to use mathematical functions

height = float(input("Enter wall height (feet): ")) #prompts user to enter wall height and store it in float type variable height

width = float(input("Enter wall width (feet): ")) #prompts user to enter wall width and store it in float type variable width

area = height *width #computes wall area

print('Wall area: {} square feet'.format(round(area))) #displays wall area using round method that returns a floating-point number rounded

sqftPerGallon = 350 #sets sqftPerGallon to 350

paintNeeded = area/ sqftPerGallon #computes needed paint

print("Paint needed: {:.2f} gallons".format(paintNeeded)) #displays computed paint needed up to 2 decimal places

cansNeeded = int(math.ceil(paintNeeded)) #computes needed cans rounding the paintNeeded up to nearest integer using math.ceil

print("Cans needed: {} can(s)".format(cansNeeded)) #displays computed cans needed

colorCostDict = {'red': 35, 'blue': 25, 'green': 23} #creates a dictionary of colors with colors as key and cost as values

color = input("Choose a color to paint the wall: ") #prompts user to enter a color

if color in colorCostDict: #if the chosen color is present in the dictionary

    colorCost = colorCostDict.get(color) #then get the color cost from dictionary and stores it into colorCost using get method that returns the value(cost) of the item with the specified key(color)

    cost = cansNeeded * colorCost #computes the cost of purchasing paint of specified color per cansNeeded

  print("Cost of purchasing {} paint: ${}".format(color,colorCostDict[color])) #displays the real cost of the chosen color paint

print("Cost of purchasing {} paint per {} gallon can(s): ${}".format(color,cansNeeded, cost)) #displays the cost of chosen color paint per cans needed.

Explanation:

The program first prompts the user to enter height and width. Lets say user enter 20 as height and 50 as width so the program becomes:

Wall area computed as:

area = height *width

area = 20 * 50

area = 1000

Hence the output of this part is:

Wall area: 1000 square feet                                                                                                                     Next program computes paint needed as:

paintNeeded = area/ sqftPerGallon

Since sqftPerGallon = 350 and area= 1000

paintNeeded = 1000 / 350

paintNeeded = 2.86

Hence the output of this part is:

Paint needed: 2.86 gallons

Next program computes cans needed as:      

cansNeeded = int(math.ceil(paintNeeded))

This rounds the computed value of paintNeeded i.e. 2.86 up to nearest integer using math.ceil so,

cansNeeded = 3                                                                  

Hence the output of this part is:

Cans needed: 3 can(s)                                                                                                                            Next program prompts user to choose a color to paint the wall

Lets say user chooses 'blue'

So the program get the cost corresponding to blue color and multiplies this cost to cans needed to compute the cost of purchasing blue paint per gallon cans. So

cost = cansNeeded * colorCost

cost = 3 * 25

cost = 75

So the output of this part is:

Cost of purchasing blue paint per 3 gallon can(s): $75                                                                                        The screenshot of the program along with its output is attached.

5 0
2 years ago
Describe at least one issue of terrorism that has happened recently.
zvonat [6]

Answer:

The republicans storming the capitol

Explanation:

6 0
2 years ago
Other questions:
  • Get these points why they hot!!!!!!!!!!!!!!!!!!!!
    14·2 answers
  • Laura wants to know more about the organization to which she has applied. What can she do to know more about the organization’s
    12·1 answer
  • How many bits would be needed to count all of the students in class today there is 20 students
    6·1 answer
  • Which of these statements makes the most sense? a folder is contained within a file. a file is contained within a folder. a driv
    9·2 answers
  • Jason Has A Science Video Project, As He Creats His Project, He Saves, Then Comes Back A Minute Later. The File Is Now Unreadabl
    8·2 answers
  • I live in Alabama and I’m ab to leave to go on a 3 week trip to France and I’m wondering how I can get LTE for my IPhone 6s Plus
    15·2 answers
  • While using a web-based order form, an attacker enters an unusually large value in the Quantity field. The value he or she enter
    15·1 answer
  • PLS HELP SOON
    15·1 answer
  • Which of the following shows the correct order of inventions that helped the first computers make calculations?
    9·1 answer
  • AYUDAAA ESPARA HOYYY
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!