Write an assignment statement to calculate the sum of the


Problem

1. Write an assignment statement to calculate the sum of the numbers from 1 to N using Gauss's formula

Sum = [N(N + 1)] / 2

Store the result in the integer variable Sum.

2. The syntax error messages displayed by a compiler are sometimes confusing. In this exercise you will become more familiar with some of the common syntax error messages produced by your Ada compiler. Enter, compile, and run the program given in Programming Warm-up Exercise

3. Then make each of the following changes and compile the program and observe the syntax error message your compiler produces. Be sure to have only one of these errors in your program at a time. That is, undo each change before making the next one. (a) Leave out the context clause "with Ada.Text_IO;" (b) Substitute "procedre" for "procedure" (c) In the first assignment statement of the program, replace the underscore character in the variable Interest_Rate with a blank (d) Leave out the declaration of the variable Charge (e) Leave off the semicolon in the declaration of the variable Charge (f) Leave off the semicolon in the first executable statement (g) Use a value of 2.5 instead of 2 for an Aft parameter in one of the Put statements (h) Leave off "Ada.Text_IO." in one of the New_Line statements (i) Misspell the parameter name Aft in one of the Put statements.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write an assignment statement to calculate the sum of the
Reference No:- TGS02650941

Expected delivery within 24 Hours