To accept numbers of integers entered at command line

Assignment Help DOT NET Programming
Reference no: EM132107382

Program using C#

This is an imcomplete code of a C# program which is supposed to accept any numbers of integers entered at the command line and display their sum.

When it is completed, the screen shows the use of 'cd', 'dir', and 'csc' commands, and the execution with output of this program with three integers, 100, 99, and -33.

It can actually accept more input numbers, if you want. Because two lines in the given code are not completed, it cannot be compiled and executed. There is a line you must complete for a for-loop to work, and another line to fix so it displays the sum on screen.

using System;

class Assignment1

{

public static void Main(string[] myInput)

{

int i, sum = 0;

Console.WriteLine("\nYou entered " + myInput.Length + " numbers:");

//

// Problem (1) Fix next line to complete the header of making a for loop......

//

for ()

{

Console.Write(myInput[i] + " ");

sum = sum + Int32.Parse(myInput[i]);

}

//

// Problem (2) Fix next line so the actual sum is displayed......

//

Console.WriteLine("\n\nSum of your input numbers = ");

Console.WriteLine("\nGood Bye!");

}

}

Example Output:

You Entered 3 Numbers:
100 99 -33

Sum of your input numbers = 166

Reference no: EM132107382

Questions Cloud

What does this tell you about the shape of this distribution : The mean of this data was found to be 42, while the median was 37. What does this tell you about the shape of this distribution
Develop and implement an interactive two-player yahtzee game : Develop and implement an interactive two-player Yahtzee game. Yahtzee is a dice game that was invented by Milton Bradley and Edwin S. Lowe in 1956.
What is the monthly reach of people 13 of facebook : The U.S. population of people 13 + is 252,904,000. Expressed as a percentage, what is the monthly reach of people 13 + of Facebook?
What is combined reach : You are advertising on two television programs that achieve the reach percentages listed. What is their combined reach?
To accept numbers of integers entered at command line : This is an imcomplete code of a C# program which is supposed to accept any numbers of integers entered at the command line and display their sum.
Using line residuals are calculated : Using Line #1, residuals are calculated and they do not sum to 0. Using Line #2, residuals are calculated and they do sum to 0.
Determine the probability that a certain number : A professor has 30 students in his or her Chemistry 101 course and wants to determine the probability that a certain number of these 30 students
An app that helps farmers make and inventory of things : An app that helps farmers make and inventory of things in their sheds/barns(with photos, notes, dictation. etc)
Number of races a marathon runner : Suppose that we regress the number of races a marathon runner wins on the average time it takes the runner in a marathon in minutes and get

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Create a constructor that initializes the instance variables

Create a constructor that initializes the 4 instance variables. The Artist class must contain a property for each instance variable with get and set accessors.

  Create an illustration of a nested if structure and build

write a 200- to 300-word short-answer response to the followinga create an example of a nested if structure and build

  What is a connectionstring

What is a ConnectionString. Give a suitable example to illustrate the various part of a ConnectionString

  Question 1a using the help of a diagram describe the layer

question 1a using the help of a diagram describe the layer of the .net framework that sits between visual basic.net

  Convert meters to feet and inches.

1. Write a program that can be used to convert meters to feet and inches. Allow the user to enter a metric meter value in a method .

  Write the function and call it in the code

Create a function called calcDiscount that will calculate and return the discount amount. Write the function and call it in the code.

  Create a button that allows user to request gpa calculation

Create a button that allows the user to request a GPA calculation at any time. (GPA = average for each class averaged for the total number of classes in a semester.)

  List out the data types available in c sharp

List out the data types available in C# and their corresponding class/struct in .NET class library.

  Create annual salary calculator

Create a new ASP.NET website called PayrollSystem. Create Annual Salary Calculator

  Write a program to convert one billion seconds

Write a C# program to convert one billion seconds (1,000,000,000 seconds) into years, months, days, hours, minutes, and seconds.

  Create the application or a web site for a business

Create the application and/or a web site for a business (choice is yours). You must use five (3) programming techniques discussed in this class. Should be database driven with at least 25 products

  What characteristics of the ajax programming style

What characteristics of the Ajax programming style do you believe will make it attractive to be utilized in applications within your workplace?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd