Implement a cardiac machine simulator in c++

Assignment Help C/C++ Programming
Reference no: EM13936882

Implement a CARDIAC machine simulator in C++, that will:

- Keep track of CARDIAC memory cells in an array of 100 integers (0-99).

- Keep track of the bug location; which could be an index into the memory array. Watch out for cells 0 and 99; they are special.

- Read the input tape from a file that starts with a number telling you how many items are on the tape.

- Output to the screen.

Running instruction 9xx exits the program.

An example run of your application would look something like this.

input.txt (This is our first CARDIAC program with 946 instead of 900 and 002 instead of the blank.)
18
002
800
030
004
020
130
021
200
022
631
023
531
024
321
025
946
002
820

Acceptable screen output:
3
2
1
0

Operation codes are as follows:

Code Abbreviation Meaning

0 INP Copy input to memory.

1 CLA Copy memory to accumulator.

2 ADD Add memory to accumulator.

3 TAC Move bug if accumulator < 0.

4 SFT Shift accumulator left then right.

5 OUT Copy memory to output.

6 STO Copy accumulator to memory.

7 SUB Subtract memory from accumulator.

8 JMP Backup bug to 99 then move bug.

9 HRS move bug and stop computing.

Reference no: EM13936882

Questions Cloud

Common approach to identifying markets : A common approach to identifying markets uses "demographic" characteristics of customers - such as age, sex, race, education, occupation, geographic location, income, marital status and family size.
Track of current inventory and re-orders automatically : Assignment 3 This assignment is marked out of 15. The marks will be scaled to be worth 15% for the assignment. The learning objectives are here. The due date is 26th October 2012. Question 1 High Level Architecture [20 marks] Devise an architectur..
Depletion rate to two decimals places : Determine the amount of depletion expense for the current year. Round the depletion rate to two decimals places.
Design experiment to clone gene xyz into recombinant vector : You are a scientist studying the effects of protein XYZ on the growth of E. coli. Design an experiment to clone Gene XYZ into a recombinant vector. Describe some of the techniques you would use to accomplish this experiment.
Implement a cardiac machine simulator in c++ : keep track of the bug location; which could be an index into the memory array. Watch out for cells 0 and 99; they are special.
The tif program case study illustrates : The case outlines for various implementations or rollouts that a number of committees, boards or groups were structured for the program. Why do you think that there were different types of groups formed? What role would they have played and what s..
Prepare summary journal entries for august : Prepare summary journal entries for August, including the disposition of under- or over- allocated conversion costs. Assume no direct materials variances.
What is the labor force participation rate : What is the labor force participation rate for 2014? How many employed workers were there at the end of 2014? How might you explain the difference between the GDP per worker you calculated and mean personal income per worker provided
Have two or more collections of data : This assignment is to summarize everything that we have addressed in the XML Applications course, and provide a mechanism to demonstrate your knowledge in a pragmatic way.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a switch-case programming for calculation

How to use C++ to write a switch-case programming for calculation? Test the program for a wide range of possible inputs including division by zero and square root of negative values.

  Construct visual basic programs in a response to common

Construct Visual Basic programs in a response to common business problems

  Advantages of compilers and interpreters

Discuss the advantages and disadvantages of compilers and interpreters

  Create the switch statement to implement set of conditions

Create the necessary switch statement to implement this set of conditions.

  Write a c function to convert gallons-quarts-pints and cups

Write a C function named liquid() that is to accept an integer number and the addresses of the variables gallons, quarts, pints, and cups.

  Compute the stress and strain in a steel rod of diameter d

Write a MAIN function and the following funcations to compute the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compress loads P of 10,000 to 1,000,000 pounds in increments of 100,000 pounds.

  Determine how many consonants are in an entered string

Write a program that determines how many consonants are in an entered string of 50 characters or less. Output the entered string and the number of consonants in the string.

  The manager of a football stadium

The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets-box, sideline, premium and general admission. The data is stored in a file, tickets.txt, in the fol..

  Write a program to calculate students average test scores

Write a program to calculate students average test scores

  Identify the primary and secondary variables

Identify the primary and secondary variables and construct the weak form of the nonlinear equation

  The stack-based routing scheme

the stack-based routing scheme you are to have a stack of maze locations.

  Write an accessor function to get the angle

Write a friend function to compare the area of a rectangle with sides 12 and 8 to the area of a parallelogram with sides 14 and 18 and an acute angle of 40 degrees. Test it in main, and check the answer by hand.

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