1 #include
2 using namespace std;
3
4 int main() {
5 int userNum;
6 int userNumSquared;
7
8 cin >> userNum;
9
10 userNumSquared = userNum + userNum; // Bug here; fix it
11
12 cout << userNumSquared; // Output formatting issue |
13
14 return 0;
15 }
16
While the zyLab platform can be used without training, a bit of training may help some students avoid common issues.
The assignment is to get an integer from input, and output that integer squared, ending with newline. (Note: This assignment is configured to have students programming directly in the zyBook. Instructors may instead require students to upload a file). Below is a program that's been nearly completed for you.
Click "Run program". The output is wrong. Sometimes a program lacking input will produce wrong output (as in this case), or no output. Remember to always pre-enter needed input.
Type 2 in the input box, then click "Run program", and note the output is 4.
Type 3 in the input box instead, run, and note the output is 6.
When students are done developing their program, they can submit the program for automated grading.
Click the "Submit mode" tab
Click "Submit for grading".
The first test case failed (as did all test cases, but focus on the first test case first). The highlighted arrow symbol means an ending newline was expected but is missing from your program's output.
Matching output exactly, even whitespace, is often required. Change the program to output an ending newline.
Click on "Develop mode", and change the output statement to output a newline: cout << userNumSquared << endl;. Type 2 in the input box and run.
Click on "Submit mode", click "Submit for grading", and observe that now the first test case passes and 1 point was earned.
The last two test cases failed, due to a bug, yielding only 1 of 3 possible points. Fix that bug.
Click on "Develop mode", change the program to use * rather than +, and try running with input 2 (output is 4) and 3 (output is now 9, not 6 as before).
Click on "Submit mode" again, and click "Submit for grading". Observe that all test cases are passed, and you've earned 3 of 3 points.

Answers

Answer 1

Answer:

Change line 10 to:

userNumSquared = userNum * userNum;

Change line 11 to:

cout << userNumSquared<<endl;

Explanation:

Though the question is a bit lengthy but the requirements are not clearly stated. However, I'm able to pick up the following points.

Print the square of the inputted numberPrint the squared number with a new line

To do this, we simply modify the affected lines which are lines 10 and 11.

The plus sign on line 10 will be modified to multiplication

i.e.

userNumSquared = userNum * userNum;

And line 11 will be modified to:

cout << userNumSquared<<endl;

Every other line of the program is okay and do not need to be modified


Related Questions

42. 43. 44. 45. 46. 47. 48 Abrasion, incised, punctured are examples of (b) strain (c) wound (a) sprain Strain is to muscle while sprain is to (a) flesh (b) blood (c) bone The natural world in which people, plants and animals live in is (a) town (b) house (c) village The act of making places and things dirty, harmful and noisy is (a) pollution (b) game (c) pollutants A set of programs that controls and coordinates the internal ac (a) translator (b) system software (c) u The following are safety measures to be considered when usin (a)overload power point (b) sitting posture (c) using the anti- (d) positioning of the monitor base ​

Answers

Abrasion, incised, punctured are examples of wound .

What type of injury is abrasion?

Abrasions is known to be a kind of superficial injuries that happens to the skin and also the visceral linings of the body.

Note that it also lead to  a break in the lifetime of tissue and as such one can say that Abrasion, incised, punctured are examples of wound .

Learn more about Abrasion from

https://brainly.com/question/1147971

#SPJ1

How is a collapsed qubit similar to a bit?

Answers

The collapsed qubit similar to a bit as it has a single value of either 0 or 1.

What is the difference between a qubit and a bit?

Note that a classical computer is one that has a memory composed of bits that is, each bit is known to hold a one or a zero.

Note also that a qubits (quantum bits) is one that can hold a one, a zero or can also superposition the both.

Hence, The collapsed qubit similar to a bit as it has a single value of either 0 or 1.

See full question below

How is a collapsed qubit similar to a bit? It can stay in a state of superposition. It is still dependent on its counterparts. It has a single value of either 0 or 1. It has numerous potential paths to follow.

Learn more about qubit from

https://brainly.com/question/24196479

#SPJ1

Describe the five components of a computer

Answers

Answer:

Input, Processing, Storage, Output and Communication devices.

Explanation:

Input devices of computer are like Keyboard, Mouse, Scanner. Output devices of a computer are printers, monitors, and headphones.

There are two storages of computer one of them is REM, which can be lost if computer shutdown/closes. Data stays written on the disk until it's erased or until the storage medium fails (more on that later). An example of a communication device is the microphone.

Which of the following is an example of how cookies are used? To create a stronger password To customize advertisements based on your history To open a program on your computer To scan your hard drive

Answers

The one among the options that is an example of how cookies are used to customize advertisements based on your history.

What do cookies do?

A cookie is known to be a kind of a small text file that is said to be often saved on your computer if a person do visit any kind of websites.

Note also that  a cookie is often used to get one to often remember settings that they have their last visit to any website.

For example Amazon is known to often cookies to help to know if or when a person revisit the site.

Hence, The one among the options that is an example of how cookies are used to customize advertisements based on your history.

Learn more about cookies from

https://brainly.com/question/14102192

#SPJ1

Answer:

To customize advertisements based on your history

Explanation:

From coding with experience i know cookies are for history browsing

What does a search engine on a computer maintain?

Answers

Answer:

The answer is below the explanation.

Explanation:

A search engine maintains the following processes in near real time: Web crawling. Indexing. Searching.

Write a function that creates a new string from a given string (as a function parameter) that consists of no digits. example get_not_digits (" Hi Mr. rober53. how are you today? today is 08.10.2019.", returns "Hi Mr. Rober. how are you today? today is.." lika a string. Help: check if the character is letter using isalpha method, and if it's digit use isdigit. Please help in Pyrhon?​

Answers

Chicken with a side of fries is c is the answer x-9(6)^2

The unit MIPS is used to measure the speed of a___.
A) Disk drive
B) Tape drive
C) Printer
D) Processor

Answers

Answer:

D) Processor

Explanation:

MIPS refers millions instruction per sec and is used to measure the speed of Processor.

I'm doing a VHDL program in Vivado, using a zyboz7 20, which would have 2 teams, each of them with different buttons and led lights. The idea is to use one button to obtain when a team scores a goal, so it will be displayed in the 7 segment-display (for example, if the button is pressed once, the display will show a one, and so on). When any of the team gets to 3, the led light given to that team will turn on.

Right now, I just have one team in the program and the constraints. Also, I have trouble understanding the debouncing of the button, I don't know if I'm using the wrong algorithm to attack the debounce issue, but it's as if the clock was delayed or it's not taking some of the input, I have been looking to a lot of tutorials but I can't find a way in which the programs can work without any issue. I will show my code here and the constraint, I will also explain the code so it will be easier to modify it if anyone can help me with the debounce issue.

Program's code:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.NUMERIC_STD.ALL;

entity sevenSementDis is
Port (
C : out STD_LOGIC;
won1: out STD_LOGIC;
team1, clk,reset: in STD_LOGIC;
SevenSD: out STD_LOGIC_VECTOR (6 downto 0));

end sevenSementDis;

architecture Behavioral of sevenSementDis is

type statetype is (Init,Gol,AnotherGol,victory);
signal state, nextstate: statetype;

signal clk_bit : INTEGER := 4;
signal clk_bit2 : INTEGER := 4;
signal count : STD_LOGIC_VECTOR (4 downto 0) := "00000";
signal clk_div : STD_LOGIC_VECTOR (4 downto 0) := "00000";
signal count_reset : STD_LOGIC_VECTOR (4 downto 0) := "00000";
signal clk_reset : STD_LOGIC_VECTOR (4 downto 0) := "00000";

begin
C<='0';

process (clk)
begin
if (clk='1' and team1='1') then
clk_div <= clk_div + '1';
end if;
end process;

process (clk_div)
begin
if (clk='1' and clk_div(clk_bit) = '1') then
count <= count + '1';
end if;
end process;

process(clk)
--variable Count : natural range 0 to 5 := 0;
begin

if rising_edge(clk) then

case(nextstate) is

when Init =>
SevenSD<="0111111";
won1<='0';
if count="00010" then
nextstate<=Gol;
else
nextstate<=Init;
end if;

when Gol =>
SevenSD<= "0000110";

if count="00011" then
nextstate<=AnotherGol;
else
nextstate<=Gol;
end if;

when AnotherGol =>
SevenSD<= "1001011";
if count="00100" then
nextstate<=victory;
else
nextstate<=AnotherGol;
end if;

when victory =>
SevenSD<= "1001111";
won1<= '1';


end case;
end if;
end process;

end Behavioral;

Explanation:

The ports: Won1 is the led light assigned to team 1. team1 is the button that I want to use when team 1 scores. The reset is also a button but I haven't been implemented. SevenSD is the 7-segment display. Clk is the clock and C is another led light that hasn't been implemented.

There are 4 states, Init(where the code starts), Gol (the team scores the first goal, which would also change the display), AnotherGol(team scores again and the display changes), and Victory (the display changes one last time and led light turns on). There are also state (which would take the actual state) and nextstate(which will tell the next state).

count is an integer that will be added when the button is 1 and the clk_div is also 1, it's the one that determines when to move to the next state. clk_bit is just the bits of the clock. clk_div is diving the clock to try to attack the debouncing issue. clk_bit2, count_reset,clk_reset are not implemented, they were created when trying to add the reset button, but when I erase them, the code just stops working at all.

the rest are some process to fight the debounce and the last one is the actual code, which goes around the different states until the victory state.

Answers

Answer:

como lo echo es echo si no tengo un pájaro es

Explanation:

un pájaro azul

The time taken to complete a motorcycle race is normally distributed, with an average time (µ) of 2.5 hours and a standard deviation (sigma) of 0.5 hours.
What is the probability that a

Answers

The probability that a randomly selected cyclist will take between 2.35 and 2.45 hours to finish the race is said to be 0.0781 = 7.81% probability.

What is the probability about?

Probability is  known to be the way or the measurement of the likelihood that a given event  will take place.

Note that in the case above, the probability that a randomly selected cyclist will take between 2.35 and 2.45 hours to finish the race is said to be 0.0781 = 7.81% probability.

See full question below

The time taken to complete a motorcycle race is normally distributed, with an average time (µ) of 2.5 hours and a standard deviation (sigma) of 0.5 hours.

What is the probability that a randomly selected cyclist will take between 2.35 and 2.45 hours to complete the race?

Learn more about race from

https://brainly.com/question/28062418

#SPJ1

give two logics how a computer is better then man ​

Answers

Answer:

Remember facts precisely without error or difficulty recalling.Perform repeated operations/actions without getting tired, bored, hungry or sleepy.Numeric calculations.Play certain games: AlphaGo Zero: Learning from scratch | DeepMindDo as they are told (though sometimes too precisely).

Explanation:

Hope it helps!!!

One of the best places to get questions answered concerning company policy is from
✔ human resources

New employees usually receive handbooks and learn about company policies
✔ during new employee orientation


A positive work ethic means people want to do their best job without considering
✔ the amount of their salary

im asking a question cuz i couldnt find the answer on brainly. for who ever needs it

Answers

Answer:

I think you should look at what your question is before you ask it because the answers are already in you question lol.

Explanation:

One of the finest resources for getting responses to inquiries about corporate policy is from human resources.

Typically, handbooks are given to new hires, in which they can learn about corporate rules during new employee orientation.

People with strong work ethics strive to do their finest work without hesitation the amount of their salary.

What are human resources?

Human resources professionals hire, filter, and interview job candidates as well as assign newly hired employees to positions. They could also be in charge of training, employee relations, and salary and benefits. Labor relations experts administer and interpret labor contracts.

Therefore, the correct options are 1-human resources, 2-during new employee orientation, and 3-the amount of their salary.

To learn more about human resources, refer to the link:

https://brainly.com/question/13190588

#SPJ2

You are writing some work instructions to assist technicians with deploying new user desktops via cloning. What type of installation and boot method is this process most likely to use, and what are the boot requirements?

Answers

The use of  ADKs and OPKs resources and some of the requirement are:

Begin  the setup from boot media.Clean the hard disk clean and make new volume(s).Install an operating system image.Who are System builder?

A system builders is one who often deploy a program to a line of devices, and it is one who complete customizations such as apps, drivers, languages, and others.

Note that The use of  ADKs and OPKs resources and some of the requirement are:

Begin  the setup from boot media.Clean the hard disk clean and make new volume(s).Install an operating system image.

Learn more about boot from

https://brainly.com/question/1827627

#SPJ1

What is the value of six sigma ? How dose it relate to agile management

Answers

For an agile team, Six Sigma would provide them with a structured approach for empirical problem solving.

The choice database does not have any impact on the relevancy of search results true or false

Answers

True. The search results a user received have no correlation with the choice of database.

How do you optimise search results in a database?

It is recommended that the best way to optimise search results lies in adjusting how the query is been made. This implies that a user can make their search results more relevant by using key phrases or making direct quotations in the search box.

For example, to achieve relevant search results of a  home address in a database, making a direct quotation of the home address in the search box would yield the desired results than simply typing a few phrases.

You can learn more search results here https://brainly.com/question/14024902

#SPJ1

I am trying to make a flowgorithm chart for a dogs name, age, weight and when their weight is less than 50 OR more than 100 its output is the dogs name. I also need to include a sentinel value to end the program. For some reason I cannot share my screen or upload a file of what I completed. I really want to get past this assignment as I have already been working on it for several days. PLEASE HELP

Answers

Answer:

i think it helps

Explanation:

sorry there was someone else rude as heck messaging and responding I couldn't see their screen name

what isig naame

oh okay

I have sent dm

i dont know your name there

A process model can _____.

A document both as-is system and to-be system
B only be used in BPR situations
C only document to-be system
D only document as-is system​

Answers

Answer:

25&⁴⁸/⅘kindly⁶⁸/⁵⅞8⁹⁰/⁴⁵

The postmortem lesson learned step is the last in the incident response process. Why is the most important step in the process?

Answers

The most important step in the process of the learned step that came last in the incident response process is to know how this threat happened and how to prevent it in the future.

What is Post-Mortem?

This refers to the medical examination of a dead body, to determine the cause of death and other possible factors that can also help to solve a murder.

Hence, we can see that from the complete text, there was a learning process that was used to teach the incident response process and this was done to help in threat prevention.

Read more about post-mortem here:

https://brainly.com/question/21123962

#SPJ1

This is your code.
>>> A = [21, 'dog', 'red']
>>> B = [35, 'cat', 'blue']
>>> C = [12, 'fish', 'green']
>>> E = [A, B, C]
What is the value of E[1][0]?
dog
cat
35
O 21

Answers

Answer:

35

Explanation:

List E is a 2 dimensional array. We want index 1 of E, which is B. Now we have an index of that list B, it is index 0 so 35.

Explain download as used in computing environment.

Answers

Explanation:

Downloading is the transmission of a file or data from one computer to another over a network, usually from a larger server to a user device. Download can refer to the general transfer of data or to transferring a specific file. It can also be called to download, DL or D/L.

please mark be brainliest

Why did NFL equip its players with RDIF tags?

Answers

NFL equip its players with RDIF tags so as aid or support them to take a lot of statistical information about the players e.g. their position, speed, acceleration and others. The data taken is often used in making a lot of analysis and coaching decisions linked to the players.

Why did NFL equip it's players with RFID tags?

This is known to be often done so that it can aid location tracking, a lot of NFL equips each player with a minimum of two RFID tags.

Hence,  NFL equip its players with RDIF tags so as aid or support them to take a lot of statistical information about the players e.g. their position, speed, acceleration and others. The data taken is often used in making a lot of analysis and coaching decisions linked to the players.

Learn more about NFL from

https://brainly.com/question/15262528

#SPJ1

List at least three kinds of harm a company could experience from electronic espionage or unauthorized viewing of confidential company materials.

Answers

The  three kinds of harm a company could experience from electronic espionage or unauthorized viewing of confidential company materials are:

Embarrassment and also the loss of customers as a result of data loss.The loss of what we call a proprietary information.The loss of what we call the sensitive business strategy information (such as  planned acquisitions, and other.).

What is E-espionage?

This  term e-Espionage is known to be a form of an unauthorized and it is often seen as a criminal access to a lot of confidential systems and information and it is one whose purpose is that they have or gain a lot of commercial or political advantage.

Hence, the types of espionage are:

Clandestine cell system.Counterintelligence, etc.

Therefore, The  three kinds of harm a company could experience from electronic espionage or unauthorized viewing of confidential company materials are:

Embarrassment and also the loss of customers as a result of data loss.The loss of what we call a proprietary information.The loss of what we call the sensitive business strategy information (such as  planned acquisitions, and other.).

Learn more about electronic espionage from

https://brainly.com/question/312313

#SPJ1

: Chronic state of ____________________, unrealistic & excessive worry about two or more life ____________________

Answers

The Chronic state of  generalized anxiety disorder is an unrealistic and excessive worry about two or more life that  last for at least six months.

What disorder is chronic worry?

Generalized Anxiety Disorder, GAD, is known to be a form of an anxiety disorder that is known by:

chronic anxiety exaggerated worry tension and others.

Note that it is also called an excessive or unrealistic worry in regards to life circumstances that is said to occur for about at least six months.

Hence, The Chronic state of  generalized anxiety disorder is an unrealistic and excessive worry about two or more life that  last for at least six months.

Learn more about Generalized Anxiety Disorder from

https://brainly.com/question/22676443

#SPJ1

what is a mini computer ? write the use of mini computer ? Please help me​

Answers

= Mini computer are medium sized computer that is smaller than other computer and powerful than micro computer.

The use of mini computer are.

= Scientific and engineering computation

= Business transactions processing

= File handling

= Databace management

I HOPE IT HELP YOU

Olivia is an amputee who wears a prosthetic right hand. Which technology would most help her operate a computer?

Answers

nerve interface is technology that allows amputees to use thoughts to move prosthetics

A computer that is not connected to a network is called a........​

Answers

Answer:

standalone computer

Explanation:

If your PC is not connected to a network, it is referred to as a standalone computer.

Hope this helped and have a good day

2 The following image shows the number of orders Company A received in 2015-2020. A financial analyst wants to calculate the year-over-year growth rate of the orders and has entered the formula for 2016 in cell C4. What steps should the analyst take to apply the same formula to all adjacent years using the Macabacus' Fast Fill Right shortcuts?​

Answers

In the above case, the thing to do is to Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R.

What are Computer shortcuts?

A computer shortcuts are known to be a composition of one or a lot of keys that bring about a command in software or operating system.

Hence, In the above case, the thing to do is to Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R.

See options below

Select cell C4, then press Ctrl + Shift + R

Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R

Select cell C4, then press Ctrl + R

Press Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R

Learn more about Computer shortcuts  from

https://brainly.com/question/12531147

#SPJ1

Consider an individual who wishes to ensure that their information remains secure and confidential, possibly to secure their personal and financial information. They are involved in communications via the internet and possibly posting information to websites. In terms of leaving evidence on the system what would be their key concerns?

Answers

In terms of leaving evidence on the system,  their key concerns is their data protection and someone hacking into the system or reading their browsing history to use it against them.

What is system hack?

System hacking is a term that connote when a person or a computer user has a compromise between computer systems and software that tends to access the target computer and steal their information or others.

In terms of leaving evidence on the system,  their key concerns is their data protection and someone hacking into the system or reading their browsing history to use it against them as well as their privacy been exposed.

Learn more about system hack from

https://brainly.com/question/13068599

#SPJ1

Help please!, explain what is missing and what needs to be changed if anything.

Answers

Using the computer language in JAVA to write a function code that output numbers in reverse

Writting the code in JAVA:

import java.util.Scanner;

public class LabProgram {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       int[] userList = new int[20];

       int numElements;

       numElements = scnr.nextInt();

       for (int i = 0; i < numElements; ++i) {

           userList[i] = scnr.nextInt();

       }

       for (int i = numElements - 1; i >= 0; --i) {

           System.out.print(userList[i] + " ");

       }

       System.out.println();

   }

}

See more about JAVA at brainly.com/question/12975450

#SPJ1

Your boss sends you an e-mail with some criticism of a report you submitted. Which of the following is the best way to respond?

THAT REPORT WAS PERFECT!
I will work on incorporating your suggestions before our deadline.
Do not respond at all. She will come find you if she wants to know if you read the e-mail.


The answer is B for whoever needs it on brainly.

Answers

Answer:

the answer is b for whoever needs the help

Enter the database function in cell i6 that determines the average salary of all full-time employees with at least one dependant.

Answers

Based on the given spreadsheet, the database function that needs to be entered into cell I6 to find the average salary of all full-time employees is =AVERAGEIFS(D5:D34,B5:B34,"FT",C5:C34,">=1")

What does the AverageIfs formula find?

You can use the AverageIfs formula to find the average of a specific group of numbers from a spreadsheet based on the shared categories that these numbers fall under.

After typing in the =AverageIfs function, you then input the range from which the category will be specified. In this case that is D5:D34. The next entry would be the range the category is picked from which is  B5:B34. The function will be FT for Full time workers.

Then use C5:C34 to find out the number of dependents that are equal to or greater than 1.

The digit returned is the average salary of all full-time employees.

Find out more on the AverageIf function at https://brainly.com/question/13661607

#SPJ1

Other Questions
Type the correct answer in each box. Use numerals instead of words. If necessary, use / for the fraction bar(s). Find the inverse of the given function. F -1(x) = x2 - , for x . Determine the [H+] , [OH], and pOH of a solution with a pH of 7.41 at 25 C. [H+]=M[OH]=MpOH= what are the spectator ions when k2s(aq) and cacl2(aq) are combined? if the fisherman caught a total of 80 kilograms of fish, how many more kilograms of bass than pike did he catch? 5. How does Gatsby say he spent his time after his family died? discuss the manner in which java passes parameters to a method. is this technique consistent between primitive types and objects? explain. Learning takes place within the _____ layer of an artificial neural network. a. middle. b. newest. c. output. d. input the potential conflict of interest when a single accounting firm provides both auditing and consulting services is that the firm can The table shows the approximate distance between selected cities and the approximate cost of flights between those cities. Calculate the correlation coefficient between cost and miles. (Round to three decimal places as needed.)CostMiles17194139730932702003884334383019(b) This table shows the same information, except that the distance was converted to kilometers by multiplying the numbers of miles by 1.609 and rounding to the nearest kilometer. What happens to the correlation coefficient when numbers are multiplied by a positive constant? (Round to three decimal places as needed.)CostKilometers171151439749772703223886974304856 calculate the taylor polynomials 2 and 3 centered at =2 for the function ()=47. how many rotational degrees of freedom does a xenon atom have? In reporting discontinued operations, the income statement should show in a special section: gains and losses on the disposal of the discontinued segment. TRUE/FALSE. Abraham Lincoln's plan at the start of the Civil War was to immediately end slavery and to fight a long, defensive war against the Southern states. Which word would best fill the blank?I have ________ read Uncle Tom's Cabin and write an essay for class. to too two Consider the economy of Wiknam. The consumption function is given by C = 250 + 0.6 ( Y T ) . The investment function is I = 100 20 r . The money demand function is ( M P ) d = Y 20 r . Round answers to two places after the decimal where necessary.a. Government purchases and taxes are both 100. In the accompanying diagram, graph the IS curve for r ranging from 0 to 8 by dragging and dropping the end points to the correct locations.b. The money supply M is 2,875 and the price level P is 5. In the accompanying diagram, graph the LM curve for r ranging from 0 to 8 by dragging and dropping the end points to the correct locations.c. Find the equilibrium interest rate, r, and the equilibrium level of income Y. An "Ordering and Receiving Materials" cost pool would most likely have as a cost driver:a) number of purchase orders.b) number of inspection tests.c) machine hours.d) number of setups. The indicator dinitrophenol is an acid with a Ka of 1. 1x104. In a 1. 0x104-M solution, it is colorless in acid and yellow in base before loading a bit in an electric drill, make sure _____. as a result of an inadequate design, a production process yields an abnormally high amount of raw material scrapped. which control goal is being violated? in scrum, the maintains the product backlog list. question 27 options: project manager scrum team product owner scrum master