1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alexdok [17]
3 years ago
11

Write a program that include a method that returns the sum of all the elements of a Linked List of Integers. Allow the user to e

nter the integers to be added to your Linked List from the console (max of 10 integers). Test your program and display your integers and the sum results.
Computers and Technology
1 answer:
Illusion [34]3 years ago
8 0

Answer:

static void Main(string[] args)

       {

           //declare a blank linked list

           LinkedList<int> numList = new LinkedList<int>();

           Console.WriteLine("Enter the Numbers");

           //check if the size of the linkedlist is 10

           while(numList.Count < 10)

           {

               //read the input supplied by the user

               string val = Console.ReadLine();

               //check if the input is integer

               if(int.TryParse(val, out _) == false)

               {

                   //if not integer, display error message and prompt for new number

                   Console.WriteLine("Invalid number");

                   continue;

               }

               //add the inputted number to the linkedlist

               numList.AddLast(int.Parse(val));

               

           }

           //call the method for linkedlist sum and display it

           Console.WriteLine(SumLinkedList(numList));

           Console.Read();

       }

       //method for linkedlist summation

       private static int SumLinkedList(LinkedList<int> val)

       {

           //declare sum as zero

           int sum = 0;

           //loop through the linkedlist to display the num and sum all numbers

           foreach(int item in val)

           {

               Console.Write(item + " ");

               sum += item;

           }

           return sum;

       }

   }

Explanation:

program written with c#

You might be interested in
Computer designers have concentrated on technology using gallium arsenide instead of silicon because silicon:
cestrela7 [59]

Answer: cannot emit light and has speed limitations

Explanation:

Silicon is usually used in computer chips and solar cells but Gallium arsenide is regarded as a better alternative even though it's costly than silicon.

Gallium arsenide has technical advantages over silicon as its electrons

move through it faster than they move through silicon. Also, cannot emit light and has speed limitations.

Gallium arsenide is used in manufacturing devices like infrared light-emitting diodes, solar cells, optical windows, etc.

7 0
3 years ago
3.What is the difference between SODIMM and UniDIMM?
lorasvet [3.4K]

Answer:

Small Outline Dual Inline Memory Module and Unbuffered Dual Inline Memory Module are two terms that describe types of computer memory. While UDIMM is a generic term that applies to most memory modules, SO-DIMM modules are used almost exclusively in notebook computers

Explanation:

6 0
4 years ago
Samantha wants to begin searching for a job using the Web. The best source for her online search will probably be __________.
zalisa [80]

Answer:

C) A company's website

Explanation:

8 0
2 years ago
____ helps determine what supplies are required for the value chain, what quantities are needed to meet customer demand, how the
pav-90 [236]

Answer:

Supply Chain Management

Explanation:

Supply Chain Management (SCM) involves all activities that are carried out between the time the raw material becomes a finished product. It also to have a critical look into the activities in the supply-side of businesses to ensure that competitive advantage is achieved and customer value is maximized.

Supply Chain Management is categorized into five parts:

  1. Planning or Strategizing: Proper planning and documentation is necessary for a successful supply chain process.
  2. Source: The location of the raw material must be identified bearing in mind its proximity to the factory or company.
  3. Production: The transition from raw materials to finished products must be monitored to ensure that standards are met.
  4. Logistics and Delivery: This stage is monitored to ensure that customer value is maximized.
  5. Return System: Monitoring and replacement of damaged or defaced goods are necessary goods.
3 0
3 years ago
JUST NEED TO KNOW WHO ALL DOSE EDGINUITY
grandymaker [24]

Answer:

I don't use it but my little brother does and I help him with it.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Please help!
    10·1 answer
  • You locate a web page that includes "edu" in the address, along with other words and symbols. the page is simple—a plain backgro
    8·1 answer
  • Suppose x = 10 and y = 20. The value of the expression
    11·1 answer
  • A(n) monitoring vulnerability scanner is one that listens in on the network and determines vulnerable versions of both server an
    7·1 answer
  • A graph of an organization'snet income over the past 10 years is an example of an analogmodel.
    7·1 answer
  • Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new vi
    13·1 answer
  • What process periodically validates a user’s account, access control, and membership role on inclusion in a specific group?a. Re
    12·1 answer
  • If you suspect corrupted system files are causing issues, what command can be run to search for and replace the corrupted files?
    13·1 answer
  • What are the common internal components to most electronic devices?
    10·1 answer
  • Please solve this in JAVA<br><br> Please see the attachment
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!