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

  Design a web page displaying list of hyperlinks

Write HTML code to design a web page displaying list of hyperlinks. Divide the browser screen into two frames. The frame on the left will be an image. The frame on the right will be a menu consisting of hyperlinks.

  Create an object oriented solution customer to purchase

Create an object oriented solution that allows a customer to purchase between 1 and 3 pizzas, add toppings to each pizza, if desired, and then displays a receipt, including the details for each pizza, a pretax total amount, and a grand total amoun..

  Write a small program scropy

You are supposed to write a small program scropy, which takes two arguments on the command line: the names of a source file and a destination file.

  Write a cpp program for magic number

Ask the user to enter a "magic number," which is an integer between 0 and 9, inclusive. Then, ask a user to enter 10 integers between 0 and 9, inclusive. If a user enters an integer outside of that range, therefore invalid, notify the user of the ..

  Program that allows the user to make some ledger transaction

Write a C program that allows the user to make some ledger transactions. The program should first prompt the user to enter the current balance of his/her ledger account (must allow for dollars and cents, and not less than zero)

  Write a c function to find the norm of a matrix

Write a C function to find the norm of a matrix. The norm is defined as the square root of the sum of squares of all elements in the matrix. Write your own code please.

  Write a program to make the ssds function

Write a program to make the SSDs function as a MM:SS real-time clock. Hint: You must not use a single delay routine for the one second delay because that will not allow for persistence of vision. The displays need to be constantly refreshed during ev..

  What are generic classes in c++

What are generic classes

  Complexity of quick sort algorithm

Write a c program to experimentally compare the O() complexities of the provided quick sort algorithm

  Returns the number of days in a month

Using only "If" statements.  Returns the number of days in a month.  Each month will be shown by a corresponding integer. This is not the most correct calculation, but Leap Year will be calculated using (Year/4) to determine if the input year is a..

  Choice lists of the case statement

In Ada, the choice lists of the case statement must be exhaustive, so that there can be no unrepresented values in the control expression. In C++,

  Produce a c program to calculate the total price for order

Your friend has just opened a computer appliances shop at Changloon. He asked your help to develop a computer program which can be used at the counter. Your program should be able to input the customer's order which could be more than one item. Produ..

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