Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me with this assembly language exercise

Status
Not open for further replies.

lephuduc.90

Newbie level 5
Newbie level 5
Joined
Sep 29, 2012
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,348
Can anyone help me to write the code for the exercise below? I'm working with PCSpim.
The following is a sample of a program output given the inputs 1 - 5:
Enter an integer: 1
Enter an integer: 2
Enter an integer: 3
Enter an integer: 4
Enter an integer: 5
Enter an integer: 0
The number of entries = 5
The sum = 15
Write a program which uses a loop to accept an unspecified number of integer inputs, keep track of how many entries are made, and calculate a running sum of the entries. When a value of '0' is entered by the user, output the results and exit the program.
 

Which programming language are you using? Can you write what you really have?
 

Use a "switch statement"(for each interger case) and a "for statement"(to calculate using urinary operators), the escape sequence for zero is the "break statement"

We cant really do every thing for you, is thwen for you to do your research on how to use the suggestion as stated, then update us with a program, if it fails to work.

Good look, do your best!
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top