Write a function ComputeVal that takes two integer parameters and returns the product of the two parameters minus 8.
Ex: ComputeVal(5, 9) returns 37.
Code:
#include
using namespace std;
/* Your code goes here */
int main() {
int input1, input2;
int result;
cin >> input1;
cin >> input2;
result = ComputeVal(input1, input2);
cout << result << endl;
return 0;
}

Answers

Answer 1

The function ComputeVal takes two integer parameters, computes their product minus 8, and returns the result.


The function ComputeVal has a return type of int, which means it returns an integer value. Therefore, the variable result in the main function is also of type int, and is assigned the return value of the ComputeVal function. Finally, the result is printed to the console using cout.

#include
using namespace std;
int ComputeVal(int a, int b) {
   return (a * b) - 8;
}
int main() {
   int input1, input2;
   int result;
   cin >> input1;
   cin >> input2;
   result = ComputeVal(input1, input2);
   cout << result << endl;
   return 0;
}

To know more about function visit:

https://brainly.com/question/28358915

#SPJ11



Related Questions

The version number of a particular application is 8.5.12. If the vendor follows the conventions described in this lesson, what is the correct
interpretation of this version number?
major release 8.5, patch 12
major release 8.5, minor release 12
major release 8, minor release 5.12, patch unknown
major release 8, minor release 5, patch 12

Answers

Answer: Major release 8, minor release 5, patch 12

Explanation:
I don’t know what you learned in your lesson, but standard convention is (major.minor.patch) for software versioning.

Cheers.

You wrote a program to allow the user to guess a number. Complete the code.
while keepGoing:
guess = input("Guess an integer from 1 to 10: ")
guess = int(guess)
attempts = attempts + 1
if guess == correct:
print("You were correct!")
keepGoing = ______
else:
if guess < correct:
print("Guess higher.")
else:
print("Guess lower. ")

Answers

Answer:

The complete program is as follows:

keepGoing = True

attempts = 0

correct = 2

while keepGoing:

    guess = input("Guess an integer from 1 to 10: ")

    guess = int(guess)

    attempts = attempts + 1

    if guess == correct:

         print("You were correct!")

         keepGoing = False

    elif guess < correct:

         print("Guess higher.")

    else:

         print("Guess lower. ")

Explanation:

This line initializes keepGoing to true

keepGoing = True

This initializes number of attempts to 0

attempts = 0

This initializes the correct guess to 2 (you can also use any number)

correct = 2

The following iteration is repeated until the number is guessed correctly

while keepGoing:

    guess = input("Guess an integer from 1 to 10: ")

    guess = int(guess)

    attempts = attempts + 1

    if guess == correct:

         print("You were correct!")

If user guess is correct, keepGoing is set to False

         keepGoing = False

    elif guess < correct:

         print("Guess higher.")

    else:

         print("Guess lower. ")

Following are the modified program to the given code:

Program Explanation:

Defining a "keepGoing" variable as bool type.Defining an integer variable "correct".Defining a while loop that use keepGoing variable to start the loop.Inside the loop a "guess" variable is defined that input value from the user-end.After input an if block is declared that check "guess" variable value equal to "correct" variable value.When the condition is false it goes into the else block in which a conditional block is used that checks the range of input and print its value.    

Program:

keepGoing = True#defining a bool variable keepGoing

correct = 5#defining an integer variable correct

while keepGoing:#defining a while loop that use keepGoing variable to start the loop  

   guess = int(input("Guess an integer from 1 to 10: "))#defining a guess variable that input integer value from user-end

   if guess == correct:#defining if block that check guess variable value equal to correct variable value

       print("You were correct!")#print message

       keepGoing = False#defining bool variable that holds boolean value

   else:#defining else block

       if guess < correct:#defining another if block that checks the range of input

           print("Guess higher.")#print message

       else:#else block

           print("Guess lower.")#print message

For the same code please find the attached file.

Output:

Please find the attached file.

Learn more:

brainly.com/question/13664230

You wrote a program to allow the user to guess a number. Complete the code.while keepGoing:guess = input("Guess
You wrote a program to allow the user to guess a number. Complete the code.while keepGoing:guess = input("Guess

Who should NOT apply for financial aid?

Students who will attend college part-time

Students whose annual family income is over $100,000

Students who will attend community college

All students should apply for financial aid

Answers

Answer: wealthy students should, not a must, apply for it. Not every student.

being a media and information literate indibidual is important especially during this modern time.give atleast three example situations that show its importance in your daily life​

Answers

Answer:

I REQUIRE POINTS CAUSE I NEED ASWERS FOR M HOMEWORK

Explanation:

why can't i click the calendar to bring up the calendar on windows 11 taskbar with a secondary screen

Answers

Click "Calendar" in the Start menu's Pinned section to get started. You might also use the Windows search to conduct a Calendar search and select the top result. You may also make the Calendar app visible from the Taskbar by selecting "Pin to taskbar."

What is  windows 11 taskbar ?

This means that even if you frequently have a dozen applications active on your desktop, you'll still see a row of relatively small icons and only a few pixels of indication that some applications, like your browser or Windows Explorer, have many windows open.Since the release of Windows 7 in 2009, Microsoft has made this scrunched-up interface the default appearance. It also makes some sense: The Quick Launch toolbar, which debuted in Windows XP, and the taskbar's window management functionality are simply combined in the design. Integrating these capabilities is a wise move going ahead as users grow accustomed to a launcher and window manager working together. 

To know more about  windows 11 taskbar , visit

https://brainly.com/question/11925100

#SPJ4

Online banking is a convenience that mostly affects which area of your life?
OA. Personal
B. Social
C. Cultural
OD. Ethical

Answers

Online banking is a convenience that mostly affects this area of a person's life: A. personal.

What is online banking?

Online banking simply refers to a type of technology that is used by financial institutions to offer their customers an opportunity to receive and send money through the Internet.

Some examples of online banking institutions include the following:

MoneygramPayment processorWestern UnionPay-Pal

In conclusion, online banking is a convenience that mostly affects the personal area of a person's life.

Read more on online banking here: https://brainly.com/question/2772610

#SPJ1

All of the following place strain on system capacity, except for:
-increased number of users.
-increased business volume.
-minimized response time for transaction processing.
-large numbers of interactive Web pages.

Answers

Out of the options provided, the one that does not place a strain on system capacity is "minimized response time for transaction processing". This is because minimizing response time actually helps to improve the efficiency of the system, which in turn reduces the strain on system capacity.

On the other hand, the other three options - increased number of users, increased business volume, and large numbers of interactive Web pages - all place strain on system capacity. An increased number of users means that the system has to handle more requests and data, which can slow down the system. Increased business volume can lead to more data and transactions, which require more processing power and storage capacity. Large numbers of interactive web pages can also put a strain on system capacity by requiring more resources to render and serve the pages.

To learn more about provided click on the link below:

brainly.com/question/31826609

#SPJ11

A class can contain many methods, and each method can be called many of times Group of answer choices True False

Answers

Answer:

True, a class can contain many methods, and each method can be called an infinite amount of times.

What is the analysis stage in System development life cycle?

Answers

Answer:

Explanation:

end user business requirements are analyzed and project goals converted into the defined system functions that the organization intends to develop. The three primary activities involved in the analysis phase are as follows: Gathering business requirement. Creating process diagrams.

Which data link layer flow control method offers the most efficient frame transmission when sending large volumes of data?.

Answers

Answer:

Data-link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame size becomes too large, then the packet may be divided into small sized frames. Smaller sized frames makes flow control and error control more efficient.

Feedback-based Flow Control method offers the most efficient frame transmission when sending large volumes of data.

What is Feedback-based Flow Control method ?

Feedback-based Flow Control (FFC): In this control technique, the sender only delivers data, information, or a frame to the receiver, who then transmits data back to the sender and permits the sender to transmit additional data or information regarding the receiver's processing or performance.

Therefore, Feedback-based Flow Control method offers the most efficient frame transmission when sending large volumes of data.

You can learn more about data link layer from the given link

https://brainly.in/question/42450298

#SPJ2

Which e-mail netiquette rules did the student break? check all that apply.

limit the use of emoticons.
always proofread before sending.
do not discuss personal information.
do not forward large attachments.
identify yourself by name.

Answers

The e-mail netiquette rules that the student broke are:

Always proofread before sending.Identify yourself by name.Do not reveal personal information.

What are the email netiquette rules?

This is known to be the rules for email etiquette and they are:

The use of a clear, professional subject words.Always Proofread all email that you send. Compose the email before entering the recipient email address and others.

The e-mail netiquette rules that the student broke are:

Always proofread before sending.Identify yourself by name.Do not reveal personal information.

Learn more about etiquette from

https://brainly.com/question/2528165

#SPJ1

Answer: The answer for the following email

Hey you guys!!!!!! LOL

A: Limit the use of emoticons

B: Always proofread before sending

E: Identify yourself by name.

Explanation:

I just did it on edge 2022.

which type of software license allows a predetermined number of people to use the account at the same time?

Answers

The 'concurrent license' type of software license permits a predetermined number of people to use the account at the same time.

A concurrent license is a type of software license that is based on the maximum number of people who will use the software or account simultaneously. For instance, if an organization purchases five concurrent licenses, it means that up to five number of its employees can use the software at any given time simultaneously; the sixth user is prohibited from the use of this software which is being allowed to use for only the five users. A concurrent license typically deals with software that runs on the server where users connect via the network

You can learn more about concurrent license at

https://brainly.com/question/13502276

#SPJ4

What makes a Computer Network different from a Computer System?

Answers

Answer:Computer hardware can be said as physical devices used with your machines. Hardware is what makes a computer system to work. Without hardware, a computer cannot function properly. A computer network system is made up of software and has linked protocols that allow a set of computer network that can be used.

Explanation:hope u ike it

URGENT! I know it has to be one of these answers, but I cannot tell the difference between them for the life of me. Help.

URGENT! I know it has to be one of these answers, but I cannot tell the difference between them for the

Answers

I don't see a difference. Otherwise, they both are correct.

three advantages to the company of using robots rather than human to manufacture company​

Answers

Answer:

Robots are able to carry heavy things such as a car.

They also do not need breaks like humans do.

They can be quicker at the job and a humans dont need to involve themselves and have a higher risk of getting hurt.

An Administrator wants to make a list of all prospects who complete the Contact Us form but only wants them to be added the first time they complete the form. If a prospect is ever removed from the list, they shouldn't be able to get added back to it. What is the best way to create this type of list

Answers

Answer:

The answer to this question can be defined as follows:

Explanation:

The easiest way to build such a list is by using an algorithm rule, where the prospects who complete the form are then matched with the rule and added to the list because the developer would also like to list of the all applicants, who fill out all the contact us Application, but still only prefer to also have them added when they fill-up the form first. When an outlook is ever omitted from the list, it should not be included.

Please answer these questions! Will mark Brainliest!!

Please answer these questions! Will mark Brainliest!!

Answers

Answer:

1) bob behnken and doug hurley

2)yes

3) august

re write the program below and correct all the errors

one = 1
two = 2
three = 3
four = one + two + 3
print(Four).

hello = "hello
world = "world"
helloWorld = hello + " " world
Print((helloworld))

Answers

one = 1

two = 2

three = 3

four = one + 3

print(four)

hello = "hello"

world = "world"

helloWorld = hello + " " + world

print(helloWorld)

difference between a technological opporunity and a technological problem

Answers

A technological opportunity is a chance to improve processes, create new products or services, or enhance user experiences through the application of technology.

What does a technological opportunity represent?

It represents potential growth and innovation, such as utilizing AI for data analysis.

Conversely, a technological problem refers to an issue or challenge with existing technology, like a software bug or a hardware malfunction.

These problems may disrupt operations or negatively impact user experience. Technological problems require solutions, and in solving them, new technological opportunities can often arise.

Read more about technology here:

https://brainly.com/question/7788080

#SPJ1

Adjust the code you wrote for the last problem to allow for sponsored Olympic events. Add an amount of prize money for Olympians who won an event as a sponsored athlete.

The

Get_Winnings(m, s)
function should take two parameters — a string for the number of gold medals and an integer for the sponsored dollar amount. It will return either an integer for the money won or a string Invalid, if the amount is invalid. Olympians can win more than one medal per day.

Here's my answer for question 1 please adjust it thanks!

def Get_Winnings(m):

if m == "1": return 75000

elif m == "2":

return 150000

elif m == "3":

return 225000

elif m == "4":

return 300000

elif m == "5":

return 375000

else:

return "Invalid"

MAIN

medals = input("Enter Gold Medals Won: ")

num = Get_Winnings(medals)

print("Your prize money is: " + str(num))

Answers

Answer:def Get_Winnings(m):

if m == "1": return 75000

elif m == "2":

return 150000

elif m == "3":

return 225000

elif m == "4":

return 300000

elif m == "5":

return 375000

else:

return "Invalid"

MAIN

medals = input("Enter Gold Medals Won: ")

num = Get_Winnings(medals)

print("Your prize money is: " + str(num))

exp: looking through this this anwser seemes without flaws and i dont follow

if you can provide what you are not understanding ican an help

PLEASE HURRY!!
Look at the image below

PLEASE HURRY!!Look at the image below

Answers

Answer:

The function usernameMaker.

Explanation:

strFirst is a local variable in the function usernameMaker since it is an argument that is passed into that function. This means that the scope of strFirst is the function usernameMaker, since it cannot be accessed anywhere else in the code.

Hope this helps :)

What hardware components are generally required for a desktop computing system?

Answers

The hardware components generally required for a desktop are the motherboard, cpu, gpu, ram, power supply, cpu cooling, m.2 storage in the motherboard. I hope this helps!

(a) Suppose that queue Q is initially empty. The following sequence of queue operations is executed: enqueue (5), enqueue (3), dequeue (), enqueue (2), enqueue (8), dequeue (), isEmpty(), enqueue (9), getFrontElement(), enqueue (1), dequeue (), enqueue (7), enqueue (6), getRearElement(), dequeue (), enqueue (4). (1) Write down the returned numbers (in order) of the above sequence of queue operations. (11) Write down the values stored in the queue after all the above operations. (b) Suppose that stack Sinitially had 5 elements. Then, it executed a total of • 25 push operations • R+5 peek operations • 3 empty operations • R+1 stack_size operations • 15 pop operations The mentioned operations were NOT executed in order. After all the operations, it is found that of the above pop operations raised Empty error message that were caught and ignored. What is the size of S after all these operations? R is the last digit of your student ID. E.g., Student ID is 20123453A, then R=3. (c) Are there any sorting algorithms covered in our course that can always run in O(n) time for a sorted sequence of n numbers? If there are, state all these sorting algorithm(s). If no, state no.

Answers

The given sequence of queue operations are:enqueue(5), enqueue(3), dequeue(), enqueue(2), enqueue(8), dequeue(), isEmpty(), enqueue(9), getFrontElement(), enqueue(1), dequeue(), enqueue(7), enqueue(6), getRearElement(), dequeue(), enqueue(4).(1) The numbers returned from the above queue operations are:5, 3, 2, 8, 9, 1, 7.

The values stored in the queue after all the operations are 4, 6. Thus, the queue contains 2 values, 4 and 6.b) The size of stack S can be found using the formula: Total elements pushed – (Total elements popped + Total empty pop error messages)In this case, the total elements pushed = 25 and the total pop operations that raised Empty error message = R. Thus, the formula becomes:25 – (15 + R) = 10 – R Therefore, the size of the stack S after all the operations is 10 – R.c)

There are two sorting algorithms that always run in O(n) time for a sorted sequence of n numbers.

These are:Counting sortRadix sort

Learn more about sequence of queue at https://brainly.com/question/31847426

#SPJ11

tokenization is the first step in text processing. please comment about what is its main purpose and what technology can be used?

Answers

Tokenization is the process of breaking down a text into smaller chunks, known as tokens.

These tokens are usually words or groups of words that can be analyzed separately and used to extract valuable information from the text. The main purpose of tokenization is to simplify the text and make it easier to analyze and process. This is especially useful in natural language processing, where complex algorithms are used to analyze large amounts of data. There are various technologies that can be used for tokenization, including regular expressions, machine learning algorithms, and rule-based systems. Regular expressions are commonly used to identify patterns in text and split it into smaller units. Machine learning algorithms, on the other hand, are trained to recognize different types of tokens and group them accordingly. Rule-based systems use a set of pre-defined rules to identify tokens based on specific criteria, such as punctuation or whitespace.

Overall, tokenization is an essential step in text processing, and it enables the efficient and accurate analysis of large volumes of text data. By breaking down a text into smaller units, tokenization makes it possible to extract meaningful insights and information, which can be used for various applications, including sentiment analysis, chatbot development, and language translation.

Learn more about tokenization here: https://brainly.com/question/13266129

#SPJ11

Sarah needs help with a presentation that she is giving the next day. What are the best ways for her to share her work to get immediate feedback? Check all that apply. with editing rights via email as a PDF file through OneDrive with read-only options via email with editing rights through OneDrive as a Word document through Office365 with commenting rights through Office365 with PowerPoint Online comment accessibility

Answers

Answer:

Office365 with PowerPoint Online comment accessibility.

The best method for her to share her work to get immediate feedback?

With editing rights through one drive. With commenting rights through Office365.With PowerPoint comment accessibility.What is the Feedback?

Feedback is known to be or occurs if outputs of a system are said to be routed back or if a person wants a response to a sent message.

Therefore, in the case above, The best method for her to share her work to get immediate feedback?

With editing rights through one drive. With commenting rights through Office365.With PowerPoint comment accessibility.

Learn more about feedback from

https://brainly.com/question/25653772

#SPJ6

Define cell in MS-Excel.​

Answers

Answer:

The intersection of rows and columns in a worksheet is called a cell

which hardware component interprets and carries out

Answers

Answer:

The processor, are also called a CPU(central processing unit) is an electronic component. That interpretes and carried out the basic instruction that operates a computer

Explanation:

When testing for current in a cable with eleven ​color-coded wires, the author used a meter to test five wires at a time. how many different tests are required for every possible pairing of five ​wires?

Answers

Multiply 5 times 5, then times 11, and you'll get 275.

define the term cyber space​

Answers

Answer: Cyberspace, is an amorphous, supposedly virtual world created by links between computers, Internet-enabled devices, servers, routers, and other components of the Internet’s infrastructure

What will happen when you run this program?

num = 10
while num > 0:
print (num)

a Syntax Error
b Logical fallicy
c Infinite loop
d Definite loop

Answers

Answer:

C. Infinite loop

Explanation:

num will be printed continuously since it will always be bigger than \(0\) (\(10\) is greater than \(0\), satisfying the condition num > 0) making it an infinite loop since it will go on forever.

Hope this helps :)

Other Questions
Which statement best describes the pharaoh's power? The pharaoh shared control with elected officials. The pharaoh had absolute control over all of Egypt. The pharaoh shared control with the ruling dynasty. The pharaoh had control over nonmilitary matters only. A substance that is insoluble in water and turns sweet in the presence of amylase, an enzyme that hydrolyzes glycosidic linkages, is most likely? the results of a multiple regression can be summarized in an anova table. match the terms from anova to their meaning in regression analysis. The first stage of the middle adulthood era, called the midlife transition, serves as the bridge between early and middle adulthood.truefalse ______ are used to create text-based documents. Multiple Choice Presentation programs Spreadsheets Databases Word processors Presentation programs. Which celestial body has a larger effect on tides which data collection technique would be the most effective way of investigating the relationship between political preferences and the economic status of north americans? ASAP! I NEED HELP!! I GIVE YOU BRAINLIEST AND COINS!!! ASAP HELPWhat factor was argued as the most important in growing cotton in the 1800s?A- Slave laborB- Foreign investmentC- Dry summersD- Improved transportation find the area of each shaded region This is algebra. Please I need help!!! write a letter to Doraemon praising him for his good deeds I need help with 2nd question please how to solve 4-2(a-1)=3+a In June 2016, you travel to France on vacation and stayed at a hotel in Paris. In January 2018, you took another trip to the same hotel for the same number of nights. The price of the room was 300 euros per night, the same as it was on your 2016 trip. The cost of your hotel bill on the 2018 trip (in U.S. dollars) compared to the cost of the 2016 trip was _____. mindtap nutrition, 1 term (6 months) instant access for whitney/rolfes understanding nutrition, 16th edition Look at the poster. Which persuasive techniques are used in this poster ? Select 2 options advanced organizers and graphic representations are commonly used in social studies. what is the advantage of using these strategies to teach content? Write the equation of the parabola in vertex form.vertex (2,4), point (3,2) The target population should be defined in terms of all of the following EXCEPT:A) elements.B) cost.C) sampling units.D) time frame.E) extent. which of the following are possible with additional nucleotides in the genetic code?