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

  Develop web services based application

Develop and test a Web services based application that meets the requirements applying SOA design principles.

  Design style elements in asp

Add drop down lists for modifying the different style elements for the label element that displays the time

  Create a shopping cart in asp

The users will use a browser to access the on-line store. The web server software for the production web server is Windows 2003 Server /IIS6.

  Inventory management system in c# application

Inventory management system in c# application

  Using .net resources to teach .net

This project will use the .NET framework to produce a set of materials to demonstrate the fundamental principles of .NET. Ideally it should demonstrate some of the principles of the framework e.g. interoperability.

  Prepare a marymount faculty site

Prepare a Marymount faculty site

  Blinky lights

Analysis proving that your code blinks the LEDs at the specified rates.

  Prepare a web application

Prepare a web application that will be used to keep track of patients registering in a hospital.

  Implementing the insurance management system

Implementing the Insurance Management System and implementation of Components as Web Services.

  Describe the characteristics of visual studio 2005

Describe the characteristics of Visual Studio 2005 Visual Studio.Net is a suite of products that includes 4 main languages. Name these languages and outline their use in industries

  What is a connectionstring

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

  Prepare a web application for internet service provider

Prepare a Web application and write the code also event planning document base. This web application allows the user to sign up for an Internet service provider for home connectivity.

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