How could the following line of code be shortened?

average = average + 1

Group of answer choices:

1.average + a

2.average += 1

3.average = + 1

4.average = 1 + average

Answers

Answer 1

Answer:

2

Explanation:

The second option is the only one that will work. The last would work but doesn't make the code any shorter.

Answer 2

Source lines of code (SLOC), also referred to as lines of code (LOC), is a software metric that counts the lines in the source code of a computer program to determine the size of the program. Thus, option B is correct.

What role of line of code if shortened?

It might be argued that writing code in fewer lines rather than several lines is more effective. There are more places for bugs to hide, and it may be more difficult to find them if you have more lines of code.

By enclosing expressions in parentheses, long lines can be split into many lines. These should be used instead of a backslash to continue a line. Ensure that the continuation line is properly indented.

Instead of breaking before a binary operator, it is preferable to break after the operator.The same results can be achieved with fewer lines of code (and perhaps even better) than with many lines of code.

Therefore, The second option is the only one that will work.

Learn more about line of code here:

https://brainly.com/question/18844544

#SPJ2


Related Questions

B. State True or False: 1. 'Date within' option allows you to search an email within a specified date range.​

Answers

Answer + Explanation:

his topic describes the email and document properties that you can search for in email items in Exchange Online and documents stored on SharePoint and OneDrive for Business sites by using the Content Search feature in the Security & Compliance Center. You can also use the *-Compliance Search cmdlets in Security & Compliance Center PowerShell to search for these properties

Please have a great day <3

Mateo wants the words "it’s snowing!" to appear in the output box and typed print (it’s snowing). this didn’t work. what needs to be added to the code?

a.
quotation marks
b.
a backslash
c.
a period
d.
a functional code

Answers

the answer is b . i just got this question right .

Answer:

a Quotation marks

Explanation:

In python, to print something it needs to have parenthesees and quotation marks.
a. Quotation marks

when would instant messaging be the least effective means of communication

Answers

Instant messaging would be least effective means of communication when you have a series of complex questions to ask your colleague.

What is the aim of instant messaging?

Instant messaging is often used as a means of sending textual messages, It is known to be a short one and also quick in nature. It can occur   between business colleagues and friends.

Its  disadvantages is that its is an Ineffective tool for mass communication and also has issues when used for system for archiving.

See options below

A. When you want your colleague to let you know if the hyperlink you sent her is working

B. When you want to tell someone "Happy Birthday!"

C. When you have a series of complex questions to ask your colleague

D. When you want to call an impromptu meeting between some of the people in your office

Learn more about instant messaging from

https://brainly.com/question/26271202

Answer:

When you have a series of complex questions to ask your colleague.

Explanation:

Asking these questions on instant messaging is the least professional way you can ask a colleague about series topics that involve your job, it would be more professional to ask this at work rather than on via message.

Data becomes _____ when it is presented in a context so that it can answer a question or support decision makin

Answers

Data becomes Moderate when it is presented in a context so that it can answer a question or support decision making.

What Does Data Mean?

Data when interpreted in the context of databases, it is known to be the full single items or things that are known  to be stored in a database.

They can come alone as individually or as a set. Data in a database is said to be often stored in database tables, that helps to organized into columns and also dictate the data types that should be stored in it .

Learn more about data from

https://brainly.com/question/179886

Two ways of calculating average returns are ______ and ______. Multiple select question. the arithmetic average the progressive average the geometric average the common average

Answers

Answer:

"Geometric Average Return Example. Jennifer has invested $5,000 into a money market that earns 10% in year one, 6% in year two, and 2% in year three. If you were to calculate this using the arithmetic mean return, you would add the rates together and divide them by three, giving you an average of 6%."

Explanation:

if you bet and another person bets do you get the money you bet and the money the other person bets?
example : say you bet on a computer game and your sister bets $5 and you bet $10 that you will win. Do you get the $10 and the $5 if you win from your sister or just the $5?​

Answers

Answer:

I believe you would get both because since you both did a bet and you won, that would mean you should automatically get both of what yall put down.

Explanation:

I think that's what should happen but I'm not sure though.

Michael bought a game he will play on his computer. The scenes in the game move smoothly, but they seem a little blurry. Which two devices--either or both-might be causing the issue?

keyboard

hard

disk

monitor

mouse

graphics card


Answers

The devices that may be causing the game to appear blurry are the graphics card and the monitor.

What is a graphics card?

The graphics card is a hardware device used in computers to improve their performance when playing videos, video games or other programs that have high graphic demand.

What is a monitor?

Monitor refers to the computer screen. This can have very varied characteristics such as size, range of colors, pixels, among others that can affect the image.

According to the above, either of these two devices can alter the image of the video game, making it look much more blurred.

Learn more about computers in: https://brainly.com/question/21080395

A programmer ensures the user inputs valid data by setting algorithms boundaries data output

Answers

Answer:

boundries

Explanation:

i did the test so trust me its right

The proper type of data is required. Users must, for instance, enter a figure in the field labeled “Total purchase units.” There must be a limit on the data's range of values. For instance, customers can only select a legitimate loan type from a list of possibilities.

What is the input's valid data by setting algorithms?

An input validation approach is used to ensure that the data given by a user is accurate.

A software might ask for a score between 0 and 50, for instance, and employ an input validation technique to make sure that numbers below 0 and beyond 50 are rejected.

Any Value—This nullifies any previous data validation. Whole Number—Only whole numbers are permitted. You might stipulate, for instance, that the user must enter a value between 0 and 30. Decimal: The user must provide a decimal-valued number.

Therefore, boundaries programmer ensures the user inputs valid data by setting algorithms boundaries data output.

Learn more about algorithms here:

https://brainly.com/question/28283722

#SPJ5

how do I fix when it hits the second session it skips scanf..
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
main() {
double first, second;
while(1){
printf(" Calculator\n");
printf("\n 7 8 9 / \n 4 5 6 x \n 1 2 3 - \nEnter operator: ");
char op;
scanf("%c" ,&op); //entering operators such as + - \ *
printf("Enter two operands:");
scanf("%lf %lf", &first, &second); //entering operands such as 1 2 5 8 12 414
switch (op) { // printing the math
case '+'://if its +
printf("%.1lf + %.1lf = %lf\n\n", first, second, first + second);
break;
case '-'://if its -
printf("%.1lf - %.1lf = %lf\n\n", first, second, first - second);
break;
case '*'://if its *
printf("%.1lf * %.1lf = %lf\n\n", first, second, first * second);
break;
case '/'://if its :
printf("%.1lf / %.1lf = %lf\n\n", first, second, first / second);
break;
default://if its not + - / *
printf("error!");
}
}
}​

Answers

Answer:

the answer can be found HERE:

https://stackoverflow.com/a/13473767

put a leading space in the scanf(" %c", &op)

Explanation:

#include <stdio.h>

#include <unistd.h>

#include <ctype.h>

main() {

double first, second;

char op;

while(1){

printf(" Calculator\n");

printf("\n 7 8 9 / \n 4 5 6 x \n 1 2 3 - \nEnter operator: ");

scanf(" %c", &op); //entering operators such as + - \ *

printf("Enter two operands:");

scanf("%lf %lf", &first, &second); //entering operands such as 1 2 5 8 12 414

switch (op) { // printing the math

case '+'://if its +

   printf("%.1lf + %.1lf = %lf\n\n", first, second, first + second);

   break;

case '-'://if its -

   printf("%.1lf - %.1lf = %lf\n\n", first, second, first - second);

   break;

case '*'://if its *

   printf("%.1lf * %.1lf = %lf\n\n", first, second, first * second);

   break;

case '/'://if its :

   printf("%.1lf / %.1lf = %lf\n\n", first, second, first / second);

   break;

default://if its not + - / *

   printf("error!");

}

}

}

How dose computers it use the information to solve problems

Answers

Answer:

A programmer's job is to find solutions. They break down problems into easy steps for a computer. 

Explanation:

hope I'm helping you!

In a ____ world, the routing updates carry subnet mask information and allow different masks to be used on different subnets.

Answers

In a classless world, the routing updates carry subnet mask information and allow different masks to be used on different subnets.

What’s the name of the technology that lets ryzen™ 5 series cpus access the entire gddr memory of radeon™ rx gpus?.

Answers

The name of the technology that lets ryzen™ 5 series cpus access the entire gddr memory of radeon™ rx gpus is AMD Smart Access Memory.

What is AMD Smart Access Memory?

AMD Smart Access Memory is known to be a type of memory that helps AMD Ryzen processors to use all their  full power of the graphics card memory.

Conclusively, it is a memory that gives room for a person to combine a Radeon RX 6000 series GPU with the used of a Ryzen processor to make your gaming performance better.

Learn more about AMD Memory from

https://brainly.com/question/18846925

HURRY IT'S URGENT
How would you create a variable named myDog and give it the value "Karel"?

options:

var myDog = "Karel":


var myDog = Karel


var myDog = "Karel";


var my Dog = "Karel"

What JavaScript function do we use to print out a message to the user?

options:

printLn()


print()


print


println();

Answers

The variable myDog and the value "Karel" are illustrations of assigning values to variable

The statement that creates the variable is (c). var myDog = "Karel";The function to print in JavaScript is (b) print()

How to create the variable?

To create a variable in JavaScript, you have to add the keyword "var".

Given that the variable name is myDog; So, we have:

var myDog

The value of the variable is "Karel".

Hence, the assignment statement is: C. var myDog = "Karel";

Function to print in JavaScript

To print in JavaScript, we make use of the print() statement

Hence, the function to print in JavaScript is (b) print()

Read more about JavaScript at:

https://brainly.com/question/16698901

What is a critical consideration on using cloud-based file sharing and storage applications.

Answers

Answer:

Determine if the software or service is authorized

Explanation:

:)

3) Write the example of LAN.​

Answers

Networking at home, Networking in an office, networking between two computers.

Networking in home, office. Networking in school, laboratory, university campus. Networking between two computers. Wi-Fi (When we consider wireless LAN).

The state of a cpu register's content is 10001.10001 in fixed point representation. what are its content if it is represents a positive real number

Answers

The fixed point representation of the state of the cpu register is a binary number

The positive real number of the state of the cpu register is 17.53125

How to determine the positive real number?

The state of the cpu register is given as:

State = 10001.10001 in binary

To convert the number to a positive real number, we make use of the following product rule

State = 1 * 2^4 + 0 * 2^3 + 0 * 2^2 + 0 * 2^1 + 1 * 2^0 + 1 * 2^-1 + 0 * 2^-2 + 0 * 2^-3 + 0 * 2^-4 + 1 * 2^-5

Evaluate the products

State = 16 + 0 + 0 + 0 + 1 + 0.5 + 0 + 0+ 0 + 0.03125

Evaluate the sum

State = 17.53125

Hence, the positive real number of the state of the cpu register is 17.53125

Read more about fixed point representation at:

https://brainly.com/question/16612919

This is an example of what type of formula?
=(D1+D17)

Answers

The type of formula that is represented by the given example =(D1+D17) in excel is known as; The SUM Formula function

What are functions in excel?

There are different ypes of formula functions in excel such as;

SUMCOUNTCOUNTAIFTRIMMAX & MIN

Now, in this question, the formula we are given is =(D1+D17) and the example it represents is the SUM formula function.

Read more about Excel Functions at; https://brainly.com/question/14042837

what is the importance of saving a web page

Answers

Answer:

to see it later and remember it

In a ________ system configuration, separate information systems are designed and managed by each foreign unit.

Answers

Answer:

In a decentralized system configuration, separate information systems are designed and managed by each foreign unit.

Explanation:

hopes this help (:

How is the development of SaaS related to cloud computing?

Answers

Answer:

SaaS cloud allows it to take advantage of the efficiencies of resource pooling and cost effective pricing models of cloud- based infrastructure

_____ is human thinking and problem-solving by a machine, including learning, reasoning, and self-correction.

Moore’s law
Moore’s law

cloud computing
cloud computing

biocomputing
biocomputing

artificial intelligence.
(Answer is artificial intelligence.)

Answers

yea, artificial intelligence :/

Answer:

It artificial intelligence / AI

Explanation:

I just took the test
EDG 2022

On a Windows computer, which tab can be used in Task Manager to set the priority given to a specific application or service?

Answers

Answer:

details tab

Explanation:

data in ai uses what >

Answers

Answer:

Explanation:

artificial intelligence describes the ability of computers to act like humans

A collection of characteristics that belong to a single person, place, or thing for which data is maintained is a(n) _____

Answers

Answer:

A collection of characteristics that belong to a single person, place, or thing for which data is maintained is a(n) record.

Explanation:

A record represents a collection of attributes that describe a real-world entity.Records consist of fields, with each field describing an attribute of that entity.

What are different social phenomenas are you aware of that used part of a social movement, change, or cause

Answers

Answer:

Social change in the broadest sense is any change in social relations. Viewed this way, social change is an ever-present phenomenon in any society.

Explanation:

Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give your eyes a short break every half hour.

Answers

Screen reading for extended periods can cause a syndrome known as the computer vision syndrome

Computer vision Syndrome

What is computer vision Syndrome?

the computer syndrome is characterised by eye discomfort and fatigue, dry eye, blurry vision, and headaches, glare, etc. Uncorrected vision problems are a major cause. it is recommended to stay off the computer for at least thirty minutes to minimise the effects

Learn more about Computer vision Syndrome here:

https://brainly.com/question/8114244

How have you improved the technology function to provide the right services at the right price and right level of quality?

Answers

What did you do? Write that as the first part

Website where customers can ask check the ,services and products, Using e-mail to improve customer service and respond to specific needs and More advanced data-gathering techniques, such as customer relationship management software.

How can technology help in customer retention?

Deals can be sent via mobile. Customers would profit from promotions and coupons supplied to their mobile devices.

This behavior is growing more sophisticated and focused. You can send promos on products or services you know a consumer enjoys based on their purchase history.

Thus, Website, E-mail and software can improve the service quality.

For further details about technology, click here:

https://brainly.com/question/16877197

#SPJ4

What problem does computer science solve in dance?

Answers

Answer:

Computer science, your able to make websites that might have videos on teaching you dance techniques.

The software that requests mail delivery from the mail server to an Internet device is known as mail ____ software.

Answers

The software that requests mail delivery from the mail server to an Internet device is known as mail client software.

Explanation:

Mail client software is a form of communication in which electronic messages are created and transferred between two or multiple devices connected to a network series or stream.

Unit 6: Lesson 2 - Coding Activity 3 for projectstem. Org coding thing

Answers

Project Stem was founded as a 501(c)(3) non-profit corporation. Its goal is to help students get the confidence they need to participate, learn, and continue in the subject of computer science.

What is a Coding Activity?

A coding activity refers to activities that help the students learn to code. Some of the activities are designed as:

GamesPuzzles and Actual assignment.

Examples of coding activities could be:

To guide a Jupiter RoverTo create a pixel puzzle etc.

Learn more about Coding Activities are:
https://brainly.com/question/25250444

Other Questions
On the poem avarice what was the speakers tone? a*b=a+2b find 2*3please help me 3. What made Queen Consort Nefertari such a prevailing force during the rule of herhusband Rameses Il? Name and describe at least four of these qualities in yourresponse. How did Greek immigrants contribute to Florida's economy? Built factories in Tampa Bay area Developed farmland near Lake Okeechobee Increased harvest and sale of sponges Produced dining room furniture PLEASE HELP!!!!!!!!! what are the advantages and diadvantages of preparing a standard solution? A plot of the maxwell distribution for the same gas against temperature shows that. How would a harsh winter most likely affect the rabbit population size?a. population decreasesb. population increasesc. population reaches carrying capacityd. population completely dies off Evin is modeling the temperature of water heating on the stove. She finds that the Fahrenheit temperature canbe modeled by the linear function F(m)=15.2m +58, where m is the number of minutes the water has beenheating. Give a physical interpretation of the parameters 15.2 and 58 in the linear model. Use appropriateunits in your explanation. What does a healthy diet look like to you? When can we say that a person is physically healthy? 18. Find the present value of a deferred annuity of 30,000.00 at the end of every year for 10 years. The first payment of a mother will be done at the end of the second year, and the money is compounded at 3% annually. a. 244,354.12 b. 248,452.51 c. 278,520.14 d. 291,245.18 The aldol condensation involves nucleophilic attack of an enolate to a carbonyl. use the pop-up menus to identify the total number of aldol products that each of the following reactions can produce. 100 divided by 35,513.22 What is the area of the parallelogram QRST? Shania is making eight gift bags to give out to her friends coming over to her house for a movie night. Each gilt bag will conpolishes and a manicure kit. Including tax, each nail polish costs $2.50 and each manicure kit costs $4.00.The following expression shows the amount of money Shania will spend on gift bags.8(2.5x + 4) Which value is a solution of the inequality 2x 3 < 9? A. x = 4 B. x = 3 C. x = 2 D. x = 3 The leader of the indian confederacy at the wabash river was ___? When making smart food choices, what question should be asked before deciding to eat at a restaurant? Which statement BEST describes what happens during the S-phase of the cell cycle?A.Protein synthesis needed for spindle formation and mitosis.B.DNA replication where the amount of genetic material is doubled.C.The cell partitions the two copies of genetic material into the two daughter cells.D.Cell division occurs and two cells are left; thus the cell cycle begins again. A bag of cement weighs 50 kg. A lorry carrying 5 t of cement breaks down. the cement is then transported in a pick up which can carry 10 bags at a time. how many trips does the pick-up make?