Calculate the sum of the numbers from one to n

Assignment Help Computer Engineering
Reference no: EM131855440

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.

Reference no: EM131855440

Questions Cloud

What are some major nonfinancial uncertainties : What are some major nonfinancial uncertainties that a company should consider when making decisions on where to source product?
Why is it important for nurses to understand concepts : Why is it important for nurses to understand these concepts?
Explain the complexity of this issue : Compare the benefits vs. the cost of this for both the buyer and the seller. What measurement for success would you recommend for this offer?
What is included in the term culture : What is included in the term "culture"? What are some attitudes that affect one's cultural competence?
Calculate the sum of the numbers from one to n : Write an assignment statement to calculate the sum of the numbers from 1 to N using Gauss's formula
What are major challenges and future trends : What are major challenges and future trends in both recruitment and retention policies and practices in HR? and recommend appropriate staffing models.
What are the major objectives of hr planning : Describe three (3) problems that can result from cutting corners to save time or money in the staffing process.
What you consider important in a training plan for managers : Make a prioritized list of what you consider important in a training plan for global managers.
What are three different training techniques you will use : What are three different training techniques you will use in the training? To what theory of Teaching do they apply?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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