Create a program called sum of numbers

Assignment Help Basic Computer Science
Reference no: EM13679293

Create a program called Sum of Numbers, with two buttons ( Enter numbers & Exit). The InputBox will be called Input Needed and will ask: Enter the positive integer value.

The answer will come in a message call Sum of Numbers stating: The sum of the number 1 through is

If the user enters a negative value, his application should display an error message. Use the following data:

Value Sum
5 15
10 55
20 210
100 5050

This is what I have so far, but I can't get the result to show in the MessageBox

Dim strUserInput
Dim IntUserInput As Integer
Dim i As Integer
strUserInput = InputBox("Enter a positive integer value", "Input Needed", 10)
If strUserInput <> String.Empty Then

Try
IntUserInput = CInt(strUserInput)
If IntUserInput < 0 Then
MessageBox.Show("Negative numbers are not accepted.")
Exit Sub
End If

'IntUserInput = (IntUserInput + i)
MessageBox.Show("Sum of Numbers", "The sum of the numbers 1 through" & (i + IntUserInput), MessageBoxButtons.OK)

Catch ex As Exception
MessageBox.Show("Quantity amount must be numeric.")
End Try
'show messages,
Else

End If
MessageBox.Show("Incorrect input", "You must enter a positive integer value", MessageBoxButtons.OK)

Reference no: EM13679293

Questions Cloud

Evaluate the change in the truck kinetic energy : As a 1220 kilogram truck travels up a 15.4 meter high hill, the non conservative forces of friction, obtain the change in the truck kinetic energy as it travels from the bottom of the hill to the top of the hill
In mips assembly language : In MIPS Assembly language
Write the sql query to return all of the information : Write the SQL query to return all of the information
Estimate the capacitance of the system : Two conductors having net charges of +13 µC and -13 µC have a potential difference of 13.0 Volt between them. Estimate the capacitance of the system
Create a program called sum of numbers : Create a program called Sum of Numbers
Evaluate what is the value of the capacitance : When a 18 Volt battery is connected to the plates of a capacitor; it stores a charge of 21.0 µC. Evaluate what is the value of the capacitance
What location would you recommend for disneys : What location would you recommend for Disneys next theme park in Asia - Tell us your reasons from the perspectives from cultural differences, market potential, and/or others.
Obtain the maximum charge the cloud can hold : Consider the Earth and a cloud layer 700 meter above the planet to be the plates of a parallel-plate capacitor. obtain the maximum charge the cloud can hold
Obtain what the magnitude of electric field between plates : Oppositely charged parallel plates are separated by 3.77 millimeter. A potential difference of 600 Volt exists between the plates. Find the magnitude of electric field between the plates

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Class templates are typically used to replace overloaded

1.How would you overload the comparison operators == and !=? What is the format to overload these operators? 2. Class templates are typically used to replace overloaded functions. Can you compare the two?

  What is the message

The following padded ASCII-coded message is stored in successive memory locations in a computer.

  Explain specific challenges of facing designer

Explain specific challenges of facing the designer, specifically with regard to limitations of hardware, software and interface design two paragraph each.

  Show the implications of the legal and ethics issues

Describe and discuss the implications of the legal and ethics issues that might arise in conducting this business online and explain the technology infrastructure, including the hardware requirements, which would be required.

  The right-hand side of this equation be written in vba

How would the right-hand side of this equation be written in VBA?

  Design a program that generates the sum of numbers

Design a program that generates the sum of numbers.

  Arrests-convictions resulting from someone hacking in bank

Search online to discover and post the article which reports any particular examples of arrests/convictions resulting from someone hacking into the bank.

  How "direction" can be used in an effective publication?

What are four examples of how "direction" can be used in an effective publication?

  Expalining independent of choice of a dbms

Which of the following is independent of the choice of a DBMS?

  Difference in tossing a fair coin to get half-and-half hs-ts

When we toss a fair coin, we expect that we get roughly half-and-half Hs and Ts. Of course, this might not happen in general: the question is, how bad can the difference get?

  What is the output of the following loop

What is the output of the following loop

  What is called a whitespace character

Given an int variable modelYear write a statement that assigns true to norecall if the value of modelYear does NOT fall within the two recall ranges and assigns false otherwise. Do not use an if statement in this exercise!

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