Need help! C programming is very confusing!

User Generated

znelznel84

Programming

Description

Taking a programming class that is very very confusing. Need to write a pesudocode for the problem in the attachment. Please help!

Unformatted Attachment Preview

Unit 2 Graded Exercise 3: Sum of a Sequence of integers (online) Lab Objective: In this lab, students will create a C program that contains a calculation within a repetitious statement. They will compile and debug their program using Visual Studio 2015. Resources required: Hardware: Xendesktop Software: Visual Studio 2015 Problem Statement Write a program that sums a sequence of integers. Assume that the first integer read with scanf () specifies the number of values remaining to be entered. Your program should read only one value each time scanf() is executed. A typical input sequence might be 5 100 200 300 400 500 Use the below program template to answer each question. The program is created by answering all the questions hence, do not skip any question. Programming Shell Template Instructions 1. Using the Xendesktop, open Visual Studio 2015. Create a new project and add a new .cpp file to the project. Type the programming shell template as stated up above and continue with the following steps below. Be sure to include comments throughout your program for readability purposes. 2. (Housekeeping): Declare the following variables in your program using appropriate data type. When selecting a data type keep in mind the type of value you want to store, i.e., int, float, character. Also, be sure to use conventional naming standards for all variable declarations. • number • sum (Hint): Since sum is going to be used for adding the value, it needs to be initialized to zero. 3. (Display Prompt): Write a printf() statement to ask user for the following message. Enter the number of values to be processed: 4. (Input): Add a scanf() statement to store user input for the number of values they wish to process. 5. (Loop structure): Now, you will write a loop structure to iterate for the number of values you want user to input. To begin with, your loop structure will look like this – 6. Declare the following variable inside the loop to store the current value. Remember, the scope of this variable is limited to the loop only. It can’t be referred or used outside the loop. • value 7. (Output): Inside the loop, write a display prompt using a printf() statement for user to input a value using the following message. 8. (Input): Write a scanf() statement to store the value the user keys in from the keyboard into the variable named value. 9. (Assignment Statement): Here comes the main part of your program. Now, you need to add this value into the variable sum. So write an assignment statement to add the input value. 10. (Output): Outside of the loop, write a printf() statement to display the value of sum. Remember, the variable sum is declared outside of the loop so it can be referred/used anywhere within the main function. Also, to display the value stored in a variable you need to include a conversion specifier inside of the quotation marks in the printf() and the variable names within the parentheses. 11. (Output Screen) When you execute the program, it should be similar to the following: Submission Instructions Upload a .c file containing the C code for this program. Use this naming convention to name your file: LastName_Unit2_GradedExercise3.c Upload Instructions: Select the Submit Assignment button to the right. Click Choose File, located in the File Upload box. Navigate to your file location. Once the file is located, select it and then select the Open button. Click Submit Assignment to complete the upload process. © 2018 ECPI
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello, Am doneUnzip to che...


Anonymous
I was struggling with this subject, and this helped me a ton!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags