Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9267587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:35:12+00:00 2026-06-18T14:35:12+00:00

How should I approach this assignment? Should I use an if/else statement? Assignment 1:

  • 0

How should I approach this assignment? Should I use an if/else statement?

Assignment 1:

Write a Windows application that accepts any number of positive values.
The user clicks a button to process all the inputted data at any time. The resulting output:

  1. sum of all the n entered numbers, followed by n rows, displayed in the order of input:
  2. the original inputted number;
  3. the percentage contributed by this number to the sum.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:35:13+00:00Added an answer on June 18, 2026 at 2:35 pm

    Though I don’t understand the project in entirety. This should at least point you in a solid direction.

    1. Open Visual Studio
    2. Select C#
    3. Choose Windows Form Application

    At this point your project will open with a canvas, in designer mode. To help describe what is happening click the Form once.

    On the right-hand side of your Window you will see Solution Explorer and Properties.

    Solution Explorer: This will show you the contents of your project. It contains the following:

    • Properties: Assembly, Resource, and Settings information.
    • References: This will contain all your project references, Assemblies that help expand your project or link to other applications you may be doing.

    The next item, is going to be your Form. This is the most important part; because this will be where all your manipulation will be.

    Now the second item I mentioned; Properties. Not the one in Solution Explorer but the tab that stands apart. Will show you all the modifications for that component. In this case, your Form.

    On the left-hand side what you’ll do is actually go to Toolbox. These are all the components that Microsoft provides you right out of the gate. Simply drag the Textbox Component out of the Toolbox onto your Form (canvas).

    You’ll notice the outline, with several transformation dots for you to manipulate location and dimensions.

    Before we move further I’ll break it down what has happened. You’ve input a blank textbox onto your Form. By default it will be called TextBox1. It is good practice to identify the component with what it is then it’s desired function. If your looking for lets say a users first name, name it txtFirst. That way it is easier to understand what your manipulating.

    Since my goal is to help point you in the right direction, follow these steps:

    1. Drag a Label– Name it lblInput (Change text to name of your choice).
    2. Drag out a Textbox– Name it txtInput.
    3. Drag out a Rich Textbox – Name it rtxtDisplay.

    Now these three components will inherently be your User Interface. All of the interaction will occur here. But we are missing one Element to the interface. A button, this is important because it will create what is called an Event. These will essentially notify the interface of a change so it appears that it is doing something.

    • Drag a Button out of the Toolbox, name is btnAdd.

    Now you have an entire interface; so now double click on the button. Your screen will now change; you’ll see all of this text.

    The important part is where it navigated you to by selecting the button.

    private void btnAdd_Click(object sender, EventArgs e)
    {
         // Implementation Here.
    }
    

    So that will provide you the Event so you can perform your logic to create your application. Now, I’m not going to do your code for you. But I’ll do something close so you can adapt and learn.

    private void btnAdd_Click(object sender, EventArgs e)
    {
        // Method One: "Casting"
        // By default txtInput is a String, you require integers.  So you can add.
        /* So you would want to ensure proper Error Handling exists, otherwise when you cast you'll receive an invalid cast exception. */
        txtInput.Text = (int)data;
    }
    

    So as you can see the // and /* are different methods to comment to make your logic easy to understand. I’m using it to explain what is happening for you. The txtInput.Text takes whatever input string value and is now being casted to an integer.

    private void btnAdd_Click(object sender, EventArgs e)
    {
         // Method Two: "Array"
         int[] data;
    }
    

    Now, this will actually allocate a reference in your memory. Which will allow you to store multiple things into the Array. This method would work well if you pass all your textbox input into your Rich Textbox. Then a second button could fill the array to add each item.

    In this example I will actually write an entire aspect but as I stated you’ll need to do certain things to make it meet your needs.

    public partial class Form1 : Form
    {
       // Create Storage
       List<string> store = new List<string>();
    
       private void button1_click(object sender, EventArgs e)
       {
           // Will add the input of the textbox to list each time button clicked.
           store.Add(textbox1.Text);
       }
    
       private void button2_click(object sender, EventArgs e)
       {
           // Logic to Add the items.
       }
    }
    

    There is half your battle right there. Things to help you truly understand this conceptually, will be these items to help you complete your project.

    • Casting
    • Arrays
    • Generics
    • Loops

    Hopefully that helps you. Those are some basic lessons; I might suggest the entry level tutorial courses on MSDN.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From my understanding of the docs this general approach should work: begin try1 rescue
I just wanted to gauge opinions on how I should approach this problem and
I have done a homework assignment, here is the problem statement: Your program should
Before I begin, I should probably mention that this sort of thing should probably
I'm wondering how I should approach a homework assignment. I must develop a simple
One attempted approach was to use TexturePaint and g.fillRect() to paint the image. This
Looking for suggestions on how to approach my Perl programming homework assignment to write
For my assignment, we have to write a primitive function which looks like this:
The assignment given was, write a program that reads numbers off of a file,
How should I best approach drawing a scatter plot diagram in Cocoa?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.