Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSCI 311 Project 2 Individual Assignment Due: February 5, 2018 Points: 15 Purpose: The objective of this project is to gain experience with C language

image text in transcribed
image text in transcribed
CSCI 311 Project 2 Individual Assignment Due: February 5, 2018 Points: 15 Purpose: The objective of this project is to gain experience with C language pre- processor directives and bit-wise operators. Requirements: The assignment centers around an integer whose digits are to be interpretation of what is a digit is to be based on whether a compile-time option specifies that binary or hexadecimal digits are to be used. Whenever possible you must make use of bit-wise operators (not arithmetic operators). reversed. The This assignment is an individual assignment: own solution to the assignment. You are expected to produce your 2. header file: In addition to a.c file, also write and use a header (.h) file. Include in this header file your #define statements and other appropriate items. 3. main routine: The main routine is to be structured as follows: set number based on compile-time selection (see item 4.c below). for each digit in the number: extract digit from number display original number and reversed number in binary or hexadecimal: perform another reversal of the reversed number and verify that the second insert into reversed number see item 4.d below number matches the original number. Except for perhaps a function to display numbers to a specified base, main is not to use functions that you write, but must use macros as explained below. 4 macros: You must write and use several macros to accomplish this project: Write one macro to extract a digit from the number. This macro must work for both binary digits and hexadecimal digits. Write one macro to insert a digit into the reversed number. This macro must work for both binary digits and hexadecimal digits. Use a #define to specify the selected number. It must be possible to select one of the following three numbers without editing the program or inputting values into the program at runtime. The three numbers are: a. b. c. 0x13579BDF, -65536, and 100. Use the -D option on the ce-command to specify whether digits are to be base 2 or base 16; the default is base 16. This option also specifies d. Spring 2018 Csci311 me

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago