Question Details

[answered] Lab Program 4 - Binary, hex, decimal, ASCII & a


Need program help in C. Thank you in advance. I need help fixin my program here is what the code looks like and what I need to do for the assignment. I have attached the file with the assignment and the output for the program.?

#include <stdio.h>
#include <stdlib.h>

char *ToLower(int n);

int main()
{
?? int b, x;
?? b = 21;

?? for(x = 0; x < 8; x++)
?? {
?? ??? printf("%s 0x%04X %4dn", ToLower(b), b, b);
?? ??? b <<= 1;
?? }
?? return 0;
}
char *ToLower(int n)
{
?? static char bin[17];
?? int x;

?? for(x = 0; x < 16; x++)
?? {
?? ??? bin[x] = n & 0x8000 ? '1' : '0';
?? ??? n <<= 1;
?? }
?? bin[x] = ' ';
?? return (bin);
}

Here's what I need to do.

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 char ToLower(char myLetter)

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 manipulation not addition or
subtraction. That is the conversion must be accomplished using an AND, OR,
XOR, or NOT operation - as appropriate.



Lab Program 4 - Binary, hex, decimal, ASCII &amp; a

 

function

 

Michael McAlpin

 

Instructor - COP3502 - CS-1

 

Fall 2016

 

EECS-UCF

 

michael.mcalpin@ucf.edu

 

November 27, 2016

 

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.

 

1 2.1 char ToLower(char myLetter) 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 manipulation not addition or

 

subtraction. That is the conversion must be accomplished using an AND, OR,

 

XOR, or NOT operation - as appropriate. 3 Outputs The output of the program will be for the upper &amp; lower case letters A through Z.

 

The outputs are shown below.

 

UPPER

 

binary

 

0100 0001

 

0100 0010

 

0100 0011

 

0100 0100

 

0100 0101

 

0100 0110

 

0100 0111

 

0100 1000

 

0100 1001

 

0100 1010

 

0100 1011

 

0100 1100

 

0100 1101

 

0100 1110

 

0100 1111

 

0101 0000

 

0101 0001

 

0101 0010

 

0101 0011

 

0101 0100

 

0101 0101

 

0101 0110

 

0101 0111

 

0101 1000

 

0101 1001

 

0101 1010 Hex Dec 41 65 A

 

42 66 B

 

43 67 C

 

44 68 D

 

45 69 E

 

46 70 F

 

47 71 G

 

48 72 H

 

49 73 I

 

4a 74 J

 

4b 75 K

 

4c 76 L

 

4d 77 M

 

4e 78 N

 

4f 79 O

 

50 80 P

 

51 81 Q

 

52 82 R

 

53 83 S

 

54 84 T

 

55 85 U

 

56 86 V

 

57 87 W

 

58 88 X

 

59 89 Y

 

5a 90 Z lower

 

binary

 

0110 0001

 

0110 0010

 

0110 0011

 

0110 0100

 

0110 0101

 

0110 0110

 

0110 0111

 

0110 1000

 

0110 1001

 

0110 1010

 

0110 1011

 

0110 1100

 

0110 1101

 

0110 1110

 

0110 1111

 

0111 0000

 

0111 0001

 

0111 0010

 

0111 0011

 

0111 0100

 

0111 0101

 

0111 0110

 

0111 0111

 

0111 1000

 

0111 1001

 

0111 1010 2 Hex

 

61

 

62

 

63

 

64

 

65

 

66

 

67

 

68

 

69

 

6a

 

6b

 

6c

 

6d

 

6e

 

6f

 

70

 

71

 

72

 

73

 

74

 

75

 

76

 

77

 

78

 

79

 

7a Dec

 

97

 

98

 

99

 

100

 

101

 

102

 

103

 

104

 

105

 

106

 

107

 

108

 

109

 

110

 

111

 

112

 

113

 

114

 

115

 

116

 

117

 

118

 

119

 

120

 

121

 

122 a

 

b

 

c

 

d

 

e

 

f

 

g

 

h

 

i

 

j

 

k

 

l

 

m

 

n

 

o

 

p

 

q

 

r

 

s

 

t

 

u

 

v

 

w

 

x

 

y

 

z 4 Grading Scoring will be based on the following rubric:

 

Table 1: Grading Rubric

 

Percentage

 

-100

 

- 30

 

- 20

 

- 20

 

- 20

 

- 20

 

- 10 5 Description

 

Cannot compile on Eustis

 

Does not convert UPPER case to lower

 

case using bit manipulation

 

Cannot output binary value

 

Cannot output hex value

 

Cannot output decimal value

 

Cannot output character value

 

Output does not match format shown in the

 

Output section defined above. Submission Instructions The assignment shall be submitted via WebCourses.

 

The source file named myHexLetters.c. 1 1 With comments that confirm - ?Your statement that the program is entirely your own work and that

 

you have neither developed your code together with any another person, nor copied program code from any

 

other person, nor permitted your code to be copied or otherwise used by any other person, nor have you

 

copied, modified, or otherwise used program code that you have found in any external source, including but

 

not limited to, online sources?. 3

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Sep 18, 2020

PRICE: $15

Solution~0001013035.zip (25.37 KB)

Buy this answer for only: $15

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy from our tutoring website www.aceyourhomework.com (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 18, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now