build me a program

Ukończone Opublikowano 4 lat temu Płatność przy odbiorze
Ukończone Płatność przy odbiorze

Problem Statement:

In the program, you must read commands which will require you to perform some operation on either one or two bit patterns, determine the result of the operation, and output accordingly. The binary operands will contain exactly 8 bits, where a bit is a binary digit. A byte contains 8 bits.

The commands are as follows:

NOT

AND.

OR

CONVERT

LSHIFT

Input

: one of the above commands, starting in column 1 of the data file

<1st operand>: the 1st binary operand, a sequence of eight 0's and 1's starting in column 10. Shift commands will also have an integer following the binary number, starting in column 20.

<1st operand>: the 2nd binary operand, for commands which require it, starting in column 20

BAD DATA: you must check for invalid command names. You may assume that the binary operands are all correctly given in the data file

You may hard code the file name into your program. You are required to implement a check to see if the data file has opened successfully, and if it has not, your code must terminate the program with a descriptive error message. You can use either the return function and implement a second return in main or you may use the exit function.

An additional test data file, which is smaller and may be used for your early testing, is also given on the web site and is named small.txt.

Output and an example:

Here is sample output, using the smaller test data file as input:

************************************************

* *

* Eight Bit Binary Number Manipulator *

* *

************************************************

COMMAND Operand #1 Operand #2 Shift Result

4

----------------------------------------------------------

NOT 11010011 00101100

AND 10010010 11001110 10000010

OR 10011001 11100101 11111101

CONVERT 10010110 150

LSHIFT 11001101 3 01101000

WRONG 01010100 --- ERROR! Invalid Command ---

Execution Completed.

Use Of Functions

Part of your grade on this and all future course programming projects will be determined by how

well you utilize functions and parameters appropriately. Start by working on a good design,

structure chart, etc. Your program must contain at least seven functions other than main, and

represent a modular, cohesive design following class style guidelines.

Note: it is not efficient to use the pow function (in the cmath header file) to calculate the integer

powers of 2. Since pow uses doubles and must do data type conversions each time it is called, it

is not efficient for the integers in this program. Instead, it is better and it is required to write up

your own function to calculate integer powers of 2 (and this function may not call pow!).

Use Of Data Structures and Data Types

The major goal of this project is to familiarize you thoroughly with various aspects of processing

standard core C++ language 1-dimensional arrays. For this reason, you must use 1-dimensional

arrays of basetypeint to store the binary numbers (bit patterns). Then use what you have learned

about arrays to perform the required manipulations on them. You may NOT use C++ strings to

store the binary operands. You must use the C++ typedef construct to set up your arrays and

pass them as parameters.

You are required to use C++ string class variables to store and compare the commands. The

ONLY classes you may use in this program are the standard C++ string class (for the commands

only) and the standard basic iostream classes (for standard input and output).

DO NOT use the C++ operators for bitwise operations to perform your bit pattern

manipulations. You are required to set up the arrays and write the code to do these tasks

yourself.

Note: by convention, bits in a byte are numbered starting from 0 going from left to right. This is

consistent with an array with indices from 0 through 7.

Programowanie w C++ Programowanie C Architektura oprogramowania Algorytmy

Numer ID Projektu: #24798638

O projekcie

6 ofert Zdalny projekt Aktywny 4 lat temu

Przyznany użytkownikowi:

shahmeeraslam547

Hi My name is Shahmeer Aslam. I’m expert in making projects and assignments on MS Office ( Word,Excel,Powerpoint,etc.). I’m Experienced in data entry, web research and coding in C++. I will complete your work on time o Więcej

$30 USD w 1 dzień
(2 ocen)
1.0

6 freelancerów złożyło ofertę za $110 w tym projekcie

gokulanand

Hello I read your problem description. I can get you a program implemented as per your spec to do binary operations. Please let me know if you are interested. Thanks Gokul

$100 USD w ciągu 2 dni
(69 Oceny)
6.0
Darwish001

I CAN COMPLETE YOUR PROJECT EASILY Hello, I am programmer with enough experiences on C/C++ for 13 years. C/C++ is nice programming language and I am majoring on it for long years so I have confident to complete your pr Więcej

$140 USD w ciągu 7 dni
(7 Oceny)
5.5
dbsft2058

I have exp in C Programming Algorithm Software Architecture C++ Programming PHP MySQL Debugging Payment Gateway Integration Magento 2

$140 USD w ciągu 7 dni
(0 Oceny)
0.0
etalhak

Hello, I am quite experienced with C/C++ programming and I have checked all of the files. I can help you with your project. Just let me know. Best regards

$110 USD w ciągu 7 dni
(0 Oceny)
0.0