Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(WRITTEN IN C Programming Language) Abstract The purpose of this lab problem is to print the binary, hex, decimal, and ASCII values of the upper

(WRITTEN IN C Programming Language)

Abstract

The purpose of this lab problem is to print the binary, hex, decimal, and ASCII values of the upper and lower case alphabet.

This problem will only work with the letters A through Z, upper and lower case. The UPPER case letters will be converted to lower case by invoking the conversion function named ToLower. This function will only use bit manipulation to accomplish the conversion.

1.) Objectives

1.1 Inputs

The only input is the name of the program - myHexLetters. No other command line parameters are required.

1.1.1 Command Line arguments

The program will be invoked as follows:

myHexLetters

2.) Process

The program myHexLetters will generate and display the upper and lower case letters from A through Z. The conversion will be accomplished on a character basis using bit manipulations described in more detail below. 2.1 charToLower(charmyLetter)

Description: Converts the UPPER case letter to a lower case letter.

Returns: The lower case letter that was passed as input.

Caveat: The conversion must be accomplished using bit manipulationnotaddition or subtraction. That is the conversion must be accomplished using an AND, OR, XOR, or NOT operation - as appropriate.

2.2) voidprintBinary(intsomeNum)

Description: Print the lower order 8 bits of an integer in binary.

Returns: Nothing.

Caveat: It is acceptable to use a loop over the 8 bits to determine if the bit under test is either a zero or a one. It is not acceptable to hard code the values of the 256 (or16) possible combinations.

3.) Outputs

The output of the program will be for the upper & lower case letters A through Z. The outputs are shown below.

image text in transcribed

image text in transcribed

It is acceptable to print the output in a single column, that is for the upper case letters rst, then the lower case letters.

UPPER binary Hex Dec Lower binary Hex Dec 0100 0001 41 65 A 0110 0001 61 97 a 0100 0010 42 66 B 0110 0010 62 98 b 0100 0011 43 67 C0110 0011 63 99 c 0100 0100 44 68 D 0110 0100 64 100 d 0100 0101 45 69 E 0110 0101 65 101 e 0100 0110 46 70 F 0110 0110 66 102 f 0100 0111 47 71 G 0110 0111 67 103 g 0100 1000 48 72 H0110 1000 68 104 h 0100 1001 49 73 I 0110 1001 69 105 i 0100 1010 4a 74 J 0110 1010 6a 106 j 0100 1011 4 75 K 0110 1011 6b 107 k 0100 1100 c76 L 0110 1100 6c 108 1 0100 1101 4d77 M 0110 1101 6d 109 m 0100 1110 4e 78 N 0110 1110 6e 110 n 0100 1111 4f 79 O 0110 1111 6f 111 o 0101 0000 50 80 P 0111 0000 70 112 0101 0001 51 81 Q 0111 0001 71 113 q 0101 0010 52 82 R 0111 0010 72 114 r 0101 0011 53 83 S0111 0011 73 115 s 0101 0100 54 84 T 0111 0100 74 116 t

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions