write a program that prints the sum of two selected numbers from a line –first line of input contains the number of lines to follow –first number of each line, n>

Answers

Answer 1

Using the knowledge in computational language in JAVA it is possible to write a code that prints the sum of two selected numbers from a line.

Writting the code:

import java.util.*;

public class Main

{

public static void main(String[] args)

{

    // create a Scanner Object

    Scanner sc = new Scanner(System.in);

   

    //declare required variables

    int number_of_lines, total_numbers;

 

    //take input of number_of_lines

    number_of_lines = sc.nextInt();

 

     //initialize array to store the sum of values for each line

     int []sum_arr =  new int [number_of_lines];

 

 

       //loop runs to take the numbers as input and calculate their sum

       //and store in the array.

 for(int i=0;i<number_of_lines;i++)

 {

     // first take the count of numbers to be inserted in each

     //row

     total_numbers =  sc.nextInt();

     

     // since last two are the indices,  create an array with size 2

     //less than total_numbers

     int [] numbers =  new int[total_numbers-2];

     

     //loop to take the numbers into array

     for(int j=0;j< total_numbers-2 ;j++){

         numbers[j] = sc.nextInt();

     }

     int sum_of_numbers = 0;

     

     // take the last two indices as input and find

     //the values in the numbers array

     //then calculate their sum

     sum_of_numbers += numbers[sc.nextInt()-1];

     sum_of_numbers += numbers[sc.nextInt()-1];

     

     //finally store the sum on an array.

     sum_arr[i] = sum_of_numbers;

   

     

 }

 

 //loop to print the sums

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

     System.out.println(sum_arr[i]);

 }

 

}

}

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

#SPJ1

Write A Program That Prints The Sum Of Two Selected Numbers From A Line First Line Of Input Contains

Related Questions

which statement accurately compares the Restart at 1 and Continue Numbering features of Word

Answers

Answer:

The Continue Numbering feature can be used to maintain the numbering order in a list and the Restart at 1 feature can be used to make a new list.

Which of the following is another name for the “processor”?

A.
CPU

B.
RAM

C.
DVD

D.
HDD

Answers

Answer:

A - CPU

CPU means "Central Processing Unit"

Read the sentence. then answer the question that follows. the child's antipathy towards broccoli was clear; she held her nose and gagged every time it was present on her plate. using the inference context clue provided, what does antipathy most nearly mean in this sentence? ambition comfort dislike support

Answers

The inference is that the meaning of antipathy in this sentence is C. Dislike.

How do you explain inference?

In literature, the inference has to do with the deduction that readers can make based on the information that the author gives. It should be noted the words that are used by authors are used to convey a particular meaning in the poem.

From the information given, it was stated that the child has an antipathy towards broccoli. It should be noted that when one had an antipathy towards something, it means that the person doesn't like that particular thing.

It should be noted that antipathy simply means the dislike for a particular thing.

Therefore, inference is that the meaning of antipathy in this sentence is Dislike. It means that the child doesn't like broccoli.

Therefore, based on the information given, the correct option to the question will be C.

Learn more about inference on:

brainly.com/question/25280941

#SPJ1

Answer:

Dislike

Explanation:

Select the correct answer from each drop-down menu.
When you right-click a picture in a word processing program, which actions can you
choose to perform on that image?
You can choose to
v an image when you right-click the picture in the word processing program. You can also choose to
V an image when you right-click the in picture in the word processing program.

Answers

Answer:

1) A

2) B

Try that.

Select the correct answer. What does the number 5 denote in the formula for Gross Words per Minute? A. number of characters in a word B. number of errors in a sentence C. number of special characters in a sentence D. number of entries in a sentence E. number of keyboard shortcuts used while typing
PLS ANSWER ASAP

Answers

Answer:

aaa

Explanation:

The correct answer is A. The number 5  represents the number of characters in a word.

What are Gross Words per Minute?

Gross Words per Minute (GWPM) is a measure of typing speed that represents the total number of words typed in a given time period, typically measured in minutes.

here,
In the formula for Gross Words per Minute (GWPM), the number 5 typically denotes the number of characters in a word. The formula for GWPM is:

GWPM = (total number of characters typed / 5) / (time taken to type in minutes)

The total number of characters typed is divided by 5 (number of characters in a word) to get the number of words typed since the average word in English is around 5 characters long. This gives the gross words typed per minute, which is a measure of typing speed.

Learn more about Gross Words per Minute here:
https://brainly.com/question/12608672
#SPJ2

if you are entering a cell address in to excel for cell f26 and you want to copy the formula that contains this address and have the row and the column stay locked, which of the follow is correct?

Answers

if you are entering a cell address in to excel for cell f26 and you want to copy the formula that contains this address and have the row and the column stay locked and it is Option 2.  F26 .

What is the cell address?

A reference is known to be a term that is used for a cell's address. It is known to be that which tends to identifies a cell or scope  of cells trough the use of  the column letter as well as row number of the cell(s).

Note that for a person to enter a cell address into a formula in Excel, one must:

Make use of cell references in a formulaSelect  the cell in for you want to input the formula.In the formula bar. , input = (equal sign).Then select the cell that has the value you want or type its cell reference and click.

Therefore, if you are entering a cell address in to excel for cell f26 and you want to copy the formula that contains this address and have the row and the column stay locked and it is Option 2.  F26 .

learn more about cell address from

https://brainly.com/question/11683350

#SPJ1

See full question below

Listen If you are entering a cell address in to Excel for cell F26 and you want to copy the formula that contains this address and NOT have the row and the column stay locked, Which of the follow is correct? $F$26 F26 OF$26 O$F26

Which statement about internet marketing is MOST accurate?


A. Internet marketing is still in its infancy and rarely used.


B. Some services can be successfully promoted via internet marketing alone.


C. Internet marketing is significantly more expensive than more traditional marketing.


D. Internet marketing works well for services but not commodities.

Answers

Answer:

search this and you'll have all the answers

Marketing Midterm Quizlet

Explanation:

Electronic hacking and illegal trespassing for the purposes of acquiring a competitor’s proprietary information is considered.

Answers

Answer:

economic espionage.

Explanation:

what can be checked on the digital set-top box (stb) to verify the reliability of the customer's drop system?

Answers

The entire drop system need to be checked on the digital set-top box (stb) to verify the reliability of the customer's drop system.

What is STB in set-top box?

A Set Top Box is known to be a kind of a device that gives room for all of its users to be able to watch any video content from any kind of internet video providers through the use of the internet.

It is a term that is often referred to as a Set Top Unit. Note that these said boxes often changes a digital television signal to that of an analog so that one can be able to watch it on a any kind of  television set, or a cable or satellite television.

Therefore, The entire drop system need to be checked on the digital set-top box (stb) to verify the reliability of the customer's drop system.

Learn more about  reliability from

https://brainly.com/question/1265793

#SPJ1

3. If a computer file will not open, what should you do? (1 poin
A

Answers

Answer:

Not sure what the options are but typically you will restart and if that won't work then check to see if the file is corrupted or not.

Explanation:

Which of the following describes a task effectively broken into smaller parts? I. Building a tree house by making a building plan, getting supplies and tools, and creating the base II. Reading a book on programming III. Comparing different walking shoes I only I and II II and III I, II, and III

Answers

The option that best describes a task effectively broken into smaller parts is option I only:

I. Building a tree house by making a building plan, getting supplies and tools, and creating the base.

What is a breakdown task?

A task can be broken down into a hierarchy of connected activities where the work is divided into general and specialized issues.

In project management and systems engineering, a work-breakdown structure is a deliverable-focused division of a project into more manageable parts.

It is an essential project deliverable that tends to share the team's work into digestible chunks is a work breakdown structure. W

Therefore, The option that best describes a task effectively broken into smaller parts is option I only:

I. Building a tree house by making a building plan, getting supplies and tools, and creating the base.

Learn more about Task breakdown from

https://brainly.com/question/14530580
#SPJ1

// todo: write a method called additem that returns a bool and takes an item parameter. // this method should iterate through the mitems array, looking for any array element // that is null. if a null item is found, it should assign that array element to the // item passed in and return true. otherwise it should return false.

Answers

A method called additem that returns a bool and takes an item parameter is given below:

The Method

public class Storage {

   private ArrayList<String> list = new ArrayList<>();

   public static final int SIZE = 10;

  public boolean addItem(String s) {

       if (isFull())

           return false;

       return list.add(s);

   }

   public String[] getItems() {

       return list.toArray(new String[list.size()]);

   }

  public boolean isFull() {

       return list.size() >= SIZE;

   }

   public boolean removeValue(String s) {

       return list.remove(s); // Removes the first occurrence of the string

   }

}

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1

write an algorithm to settle the following question: a bank account starts out with $10,000. interest is compounded monthly at 6 percent per year (0.5 percent per month). every month, $500 is withdrawn to meet college expenses. after how many years is the account depleted?

Answers

Using the knowledge in computational language in python it is possible to write a code that write an algorithm to settle the following question.

Writting the code:

original = float(raw_input("Enter initial balance: "))

interest = float(raw_input("Enter promised return: "))

expenses = float(raw_input("Enter monthly expenses: "))

interest = interest / 100 / 12

month = 0

balance = original

if balance * interest - expenses >= 0:

print "You don't need to worry."

else:

while balance + balance * interest - expenses >= 0: # negation of the if condition

balance = balance + interest * balance # in one month

balance = balance - expenses

month = month + 1

print month, balance

print month / 12, "years and", month % 12, "months"

See  more about python at brainly.com/question/18502436

#SPJ1

All computers can display any font embedded in a webpage so
designers can use unusual or really fancy fonts as regular text on a
page.

True
False

Answers

Answer:

whatiscardboatdmadeof

False. Not all computers can display all fonts, so web designers could use a standard font (eg. Sans serif) if they want all people to see the same font. Some designers may choose to use a more fancy font and then set a standard font as a “backup” that a computer can revert to if it cannot show the fancy font.

The student printed the information from the American Medical Association because:

Answers

The student printed the information from the American Medical Association due to the fact that It is one that has a lot of authority than the other websites and It is one that is seen to contain more objective than the other  kind of websites.

Why do that from American Medical Association ?

There can be a lot of reasons for the student action. The student may have printed information from AMA (American Medical Association) due to the fact that  the site  is a genuine source and had a lot of information which concludes the reason for it having a lot of  authority over other websites.

Therefore, The student printed the information from the American Medical Association due to the fact that It is one that has a lot of authority than the other websites and It is one that is seen to contain more objective than the other  kind of websites.

Learn more about American Medical Association  from

https://brainly.com/question/1656801

#SPJ1

Why are tables a good way for displaying data

Answers

Answer:

Tables are used to organize data that is too detailed or complicated to be described adequately in the text, allowing the reader to quickly see the results.

Explanation:

please make my answer as brainelist

if marcus is on a 3500-kilocalorie diet, based on the amdr for dietary fat, how many kilocalories should he obtain from dietary fat daily? 400–905 kilocalories 500–1005 kilocalories 600–1115 kilocalories 700–1225 kilocalories 800–1355 kilocalories

Answers

The numbers of kilocalories that Marcus will  obtain from dietary fat is 700-1225 kcal.

What is Calorie?

The calorie is known to be the unit of  energy especially when used for food consumption.

Note that  a large calorie, food calorie, or kilogram calorie are known to be the term that connote a given  amount of heat that is needed to increase the temperature of one kilogram of water by one degree Celsius.

Therefore, based on the question, the numbers of kilocalories that Marcus will  obtain from dietary fat is 700-1225 kcal.

Learn more about kilocalories  from

https://brainly.com/question/15983910

#SPJ1

See full question below

According to the Acceptable Macronutrient Distribution Range, 20% to 35% of the total caloric intake should come from fat. If Marcus is on a 3,500 kilocalorie diet, how many kilocalories should he obtain from dietary fat?

400-905 kcal

500-1005 kcal

600-1115 kcal

700-1225 kcal

800-1355 kcal

Anybody know this answer i need help man asap.

Answers

Answer:

b

Explanation:

I think is b because without human labor how can u create a capital or build anything

You are trying to sell a new product to a store owner. Which method of presentation is likely the most effective? a chart showing how sales will go up if they use this product a chart showing how sales will go up if they use this product quotes from other store owners on success of this product quotes from other store owners on success of this product a free trial option to use the product for six months, no questions asked a free trial option to use the product for six months, no questions asked all of the above

Answers

A method of presentation which is likely the most effective is: D. all of the above.

What is a product?

A product can be defined as any physical object (tangible item) that is typically produced by a manufacturer so as to satisfy and meet the demands, needs or wants of every customer. Some examples of a product include the following:

Mobile phones or SmartphonesTelevisionMicrowave ovenPencilRefrigeratorComputerShampooDrugs

What is a sales presentation?

A sales presentation can be defined as an act that involves the process of speaking to customers and potential customers, so as to formally share and explain information about a product such as a health care plan, Medicare Advantage plan, etc., especially for the purpose of proffering a solution to a particular problem.

In conclusion, all of the above method of sales presentation would be very effective.

Read more on sales presentation here: https://brainly.com/question/2039116

#SPJ1

Define the following terms:
i) Icon
ii)Desktop

Answers

Icon : an application
Desktop : A computer at a desk

Something that serves as a model for others to copy is a ____
document
template
copy
model

Answers

Answer: template

Explanation: because i know meanings of words

This type of boot occurs when the computer is already on and you restart it without turning off the power.

Answers

Answer:

The type of boot that occurs when the computer is already on and you restart it without turning off the power is called a Warm Boot.

The type of boot that occurs when the computer is already on and you restart it without turning off the power is called a Warm Boot or a Soft Boot.

During a warm boot or soft boot, the computer's operating system is restarted, allowing it to reload and refresh system processes and services. Unlike a cold boot, a warm boot does not involve powering off and on the computer's hardware.

Therefore, The type of boot that occurs when the computer is already on and you restart it without turning off the power is called a Warm Boot or a Soft Boot.

To know more about the Warm Boot:

https://brainly.com/question/32364841

#SPJ4

using the concept of defense in depth, which layers might we utilize to implement defenses to secure ourselves against someone removing confidential data from a desktop pc with a usb flash drive?

Answers

Environmental protections would need to be in place which would ensure USB threats were non-issue by using the concept of defense in depth. Provide them with work USB sticks that have automatic encryption protection instead of expecting them to find or utilise ones that have been supplied to them by others. One technique to ensure that there won't be a data breach if a USB stick is lost is to use encrypted devices.

A method known as "defence in depth" uses a variety of security measures to safeguard an organization's assets. The idea is that extra layers exist as a backup to ensure that threats are stopped along the road if one line of protection is breached.

In order to safeguard the confidentiality, integrity, and availability of a computer network and the data contained inside it, a number of security methods and controls are deliberately stacked throughout the network. This strategy is known as defence in depth (DiD).

Depending on the point of concentration, defence in depth can be divided into three control layers. These include administrative, technical, and physical controls.

Learn more about defense in depth:

https://brainly.com/question/13566507

#SPJ4

which of these statements about constructors is false? a. a constructor has no return type b. its name must be the same as the class in which it is defined

Answers

Both the options (a and b) are true that a constructor has no return type and its name must be the same as the name of the class in which it is defined.

In object oriented programming, a constructor is a special type of member function that is called automatically when an object of the class is created. The constructor has no return type and has the same name as that of the class in which it is defined.

This is because:

Constructor is called directly by object initialization code in the runtime, not returning any value, therefore, has no return type.The constructor is primarily used to initialize data members of an object which is an instance of class. So that is why its name must be the same as that of the class.

Therefore, the options (a and b) given in this questions are all true about constructor and there is no false option.

You can learn more about constructor at

https://brainly.com/question/27727622

#SPJ4

Which format has the largest file size? responses gif, , jpeg, , raw , , png, ,

Answers

A jpeg had the largest file size.

Raw format has the largest file size.

RAW files are uncompressed image files that contain unprocessed data directly from the camera's image sensor.

They retain all the details and information captured by the sensor, resulting in larger file sizes compared to other formats.

This format is commonly used by professional photographers and offers greater flexibility for editing and post-processing.

In some cases, specific JPEG or PNG files can have larger sizes than certain RAW files, especially if they are saved with high quality or contain complex graphics.

To learn more on File size click:

https://brainly.com/question/30506401

#SPJ6

you enable a system-assigned managed identity for vm1. to which identities can you assign the reports reader role?

Answers

The identities a person can you assign the Reports reader role is network option (B) User1 and RG1 only.

What is a system assigned managed identity?

A system-assigned managed identity is known to be a function or tool that helps Azure VMs to be able to authenticate to other  forms of cloud services without having to save credentials in code.

Note that if the tool is enabled, all the needed permissions can be granted in course of the Azure Role-Based Access Control (RBAC) access management system.

Therefore, The identities a person can you assign the Reports reader role is network option (B) User1 and RG1 only.

Learn more about Azure  from

https://brainly.com/question/28168433

#SPJ1

You have an Azure subscription that contains a user named User1, a

resource group named RG1, and a virtual machine named VM1.

You enable a system-assigned managed identity for VM1.

To which identities can you assign the Reports reader role?

(A) User1 only

(B) User1 and RG1 only

(C) User1 and VM1 only

(D) User1, RG1, and VM1

Embedded computers usually are small and have limited hardware but enhance the capabilities of everyday devices. True or false?.

Answers

Embedded computers usually are small and have limited hardware but enhance the capabilities of everyday devices is a True statement.

Are embedded computers small?

Embedded computers are known to be machine that is said to be in smaller form  of their factor motherboards. An example is Mini-ITX .

Note that there are lot of Different forms of  embedded computers that has their specific innovative enclosure designs.

Therefore, based on the above, Embedded computers usually are small and have limited hardware but enhance the capabilities of everyday devices is a True statement.

Learn more about Embedded computers  from

https://brainly.com/question/9706390

#SPJ1

which tool lets you create system maintenance tasks that are performed on a regular schedule or when system events occur? a. performance monitor b. event viewer c. iscsi initiator d. task scheduler

Answers

Task Scheduler lets you create system maintenance tasks that are performed on a regular schedule or when system events occur

The Task Scheduler is a tool in Windows that allows you to create and manage tasks that are performed on a regular basis or in response to certain events. You can use the Task Scheduler to perform system maintenance tasks, such as backing up files or running disk defragmentation, that are performed on a regular schedule. You can also use it to run tasks in response to events, such as when a user logs on or an application crashes.

The Task Scheduler is a valuable tool that can help you automate routine maintenance tasks and keep your system running smoothly.

Learn more on Task Scheduler here:

https://brainly.com/question/19999569

#SPJ4

which installation method often requires you to immediately install updates from the internet after installation is complete?

Answers

An installation method which often requires an end user to immediately install updates from the Internet after installation is complete is: CD or DVD installation.

What is a software?

A software can be defined as a set of executable instructions that is typically used to instruct a computer system on how to perform a specific task and proffer solutions to a particular problem.

What is an installation?

An installation can be defined as a process through which a software application is configured and integrated into the memory of a computer system, in order to make it ready for execution of specific task.

In Computer technology, an installation method which often requires an end user to immediately install updates from the Internet after installation is complete is CD or DVD installation.

Read more on software installation here: https://brainly.com/question/22529307

#SPJ1

Complete Question:

Which installation method often requires you to immediately install updates from the Internet after installation is complete?

answer choices

Internet installation

App Store installation

Software subscription

CD or DVD installation

now, it’s time to process the data. as you know, this step involves finding and eliminating errors and inaccuracies that can get in the way of your results. while cleaning the data, you notice there’s missing data in one of the rows. what might you do to fix this problem? select all that apply.

Answers

The thing that a person need to do that might  fix this problem are:

Ask a colleague on your team how they've handled similar issues in the pastAsk you supervisor for guidance.

Check more about errors below.

What are errors in quantitative analysis?

The term error is known to be a word that connote a mistake in a given work. Note that the types of errors in lab measurements are random error, systematic error, and others.

To be able to  remove or correct error, one must have the knowledge of what the error is and when you do not know, it is good you ask others.

Therefore, The thing that a person need to do that might  fix this problem are:

Ask a colleague on your team how they've handled similar issues in the pastAsk you supervisor for guidance.

Learn more about Data Error from

https://brainly.com/question/12600423
#SPJ1

See options below

Sort the spreadsheet so the row with missing data is at the bottom

Ask a colleague on your team how they've handled similar issues in the past

Ask you supervisor for guidance

Delete the row with the missing data point

Other Questions
a spirochete moves in a screw-like manner that is mediated by axial fibrils located in the cell's periplasmic space. Part b which detail best supports the answer to part a? life contracts and death is expected (2) six spheres of radius 1 are positioned so that their centers are at the vertices of a regular hexagon of side length 2. the six spheres are internally tangent to a larger sphere whose center is the center of the hexagon. an eighth sphere is externally tangent to the six smaller spheres and internally tangent to the larger sphere. what is the radius of this eighth sphere? (2013 amc 10a four solid plastic cylinders all have radius 2.33 cm and length 5.82 cm. find the charge of each cylinder given the following additional information about each one. For a party, Carlos buys 8 bags of popcorns and 4 bags of pretzels on sale for $10.36. During the party, he goes back to the store after the sale is over to buy 4 more bags of popcorns and 2 bags of pretzels for $20.72. Let x represent the price of each bag of popcorn and let y represent the price of each bag of pretzels. Which system of linear equations can you solve to find the price of each bag ofpopcorn and each bag of pretzels? Determine whether the underlined conjunctions in the following sentence are coordinating or correlative by choosing the letters A (coordinating) or B(correlative).The money is real, but it has been shredded. . OB. B Coordinates: (-4, 4), (5, -1)midpoint:slope:distance: refer to the image please!! if a piece of ribbon is 4 3/4 feet long, how long is it in inches? The two factors to consider when assigning a priority level to a to-do item are:A) ease and effortB) time and effortC) time and costD) importance and urgency the cleveland massacre was a takeover by standard oil of the refineries in cleveland. a labor dispute at standard oil in cleveland that turned violent. what can be checked on the digital set-top box (stb) to verify the reliability of the customer's drop system? List the supporting materials you might use for an essay on one of the following topics:1) Why people often dont help in a crisis.2) Popular misconceptions about freedom of speech.3) Comic strips that have educational value.4) Why modern products are often shoddily constructed. at expiration, calculate the total profit or loss from the stock position and the short option since selling the call (excluding commissions and fees). Determine the number of protons and electrons in each ion-(a) Na(b) Ba+(c) 0-(d) Co+ Absolute value of 2 is (2x + 4x) + (-4x + 6x - 2) Discussing the Impact of Historical Events in American Literature.Thesis: The authors of American literature were naturally Englishmen who thought and wrote in a colonial manner. While some writers emphasized the colonists' attachment to the British monarchy, others emphasized the ideological divisions that prompted them to flee their own country. The American Revolution highlighted the widening contrasts between American and British political ideologies.Supportive statements: The colonists were inspired by a number of very successful political writers, including Thomas Paine and Benjamin Franklin, as they came to the conclusion that revolution was unavoidable. Poetry was used as a tool throughout the American Revolution to express the ideas of both the loyalists and the Continentals. Satires on the Revolutionary War were successful propaganda and eventually focused on other facets of the American landscape. In the years following the American Revolution, authors in the country were urged to create authentically native literature. Multiple writersWilliam Cullen Bryant, Washington Irving, James Fenimore Cooper, and Edgar Allan Poestarted a significant literary revolution that lasted for half century.Record at least 8 questions based on these and its supportive statements as well as the responses to these questions. Mr. Thompson has a class of 14 students. He can spend $25 on each student to buy math supplies for the year. He first buys all of his students calculators,which costs a total of $84. 14. After buying the calculators, how much does he have left to spend on each student? bazar magazine coming into focus once throught to primarily affect overstimulated boys adhd has become an epidemic for adult women