Question

C programming
SPTL You have been hired by a company that makes keyboards. The company is doing a test to see which keys on the keyboard are used the most and the least. The assumption is the keys used the most will have to have better hardware and the keys used the least can have cheaper hardware. In order to be competitive in the marketplace, it is important to obtain data on the use of the keys on the keyboard The program will have the following menu: 1. Type up to 100 characters from the keyboard 2. Display how many of each key that has been pressed (in order from high to low) 3. Display the key that have never been pressed 4. Display the key that has been pressed the most 5. Quit 1. Design tool 2. Program look and feel and layout 3. Use of Functions (program should be written using individual functions) 4. Use of Arrays 5. Passing the array to a function to store characters from the keyboard 6. Sorting the Array Function

media%2Ff9d%2Ff9d777ec-7e00-40e9-8ed5-27

0 0
Add a comment Improve this question Transcribed image text
Answer #1

NOTE: Please check the code and let me know if you face any issues. I will revert back within 24 hours.

Code:
http://pasted.co/9323f15d

Since output is bigger than screen size i am copying the output here.

Execution and output:
Unix Terminal> cc key_check.c
Unix Terminal> ./a.out

====================
Keys Calculator Menu
====================
1. Type up to 100 characters from the keyboard
2. Display how many of each key that has been pressed(in order from high to low)
3. Display the key that have never been pressed
4. Display the key that has been pressed the most
5. Quit
Enter your choice? (1/2/3/4/5) 1

Start typing upto 100 characters without space and press enter to Stop...
lksajflkasjfdlasjflas;fjals;kfjaslk;fjas;lkfjaslk;fjasl;fkjsalf;kjasdfl;kjasfpiuo3qprwoqputqpoetyqerotipuyqpotuyqertvxnfznx,v.nsv,mnav,.nds,.mndsf,.mnds,.nds,m.n,mv.xzbz,.vbz,.z223094820-4280-4892530-90967523476109626=86-020-48672067813\

====================
Keys Calculator Menu
====================
1. Type up to 100 characters from the keyboard
2. Display how many of each key that has been pressed(in order from high to low)
3. Display the key that have never been pressed
4. Display the key that has been pressed the most
5. Quit
Enter your choice? (1/2/3/4/5) 2

Keys with number of times they are pressed are:
s=17
f=14
a=13
j=11
l=11
k=9
n=9
0=9
2=9
.=9
;=8
6=7
d=6
p=6
q=6
v=6
8=6
m=5
o=5
t=5
z=5
3=5
4=5
9=5
-=5
u=4
7=4
e=3
r=3
x=3
y=3
b=2
i=2
1=2
5=2
w=1
==1
\=1

====================
Keys Calculator Menu
====================
1. Type up to 100 characters from the keyboard
2. Display how many of each key that has been pressed(in order from high to low)
3. Display the key that have never been pressed
4. Display the key that has been pressed the most
5. Quit
Enter your choice? (1/2/3/4/5) 3

Keys not Pressed are:

c = 0
g = 0
h = 0
A = 0
B = 0
C = 0
D = 0
E = 0
F = 0
G = 0
H = 0
I = 0
J = 0
K = 0
L = 0
M = 0
N = 0
O = 0
P = 0
Q = 0
R = 0
S = 0
T = 0
U = 0
V = 0
W = 0
X = 0
Y = 0
Z = 0
~ = 0
! = 0
@ = 0
# = 0
$ = 0
% = 0
^ = 0
& = 0
* = 0
( = 0
) = 0
_ = 0
+ = 0
` = 0
/ = 0
< = 0
> = 0
? = 0
: = 0
" = 0
' = 0
{ = 0
[ = 0
} = 0
] = 0
| = 0
====================
Keys Calculator Menu
====================
1. Type up to 100 characters from the keyboard
2. Display how many of each key that has been pressed(in order from high to low)
3. Display the key that have never been pressed
4. Display the key that has been pressed the most
5. Quit
Enter your choice? (1/2/3/4/5) 4

Key that has been pressed the most are: s = 17
====================
Keys Calculator Menu
====================
1. Type up to 100 characters from the keyboard
2. Display how many of each key that has been pressed(in order from high to low)
3. Display the key that have never been pressed
4. Display the key that has been pressed the most
5. Quit
Enter your choice? (1/2/3/4/5) 5

Add a comment
Know the answer?
Add Answer to:
C programming SPTL You have been hired by a company that makes keyboards. The company is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using C programming For this project, you have been tasked to read a text file with student grade...

    Using C programming For this project, you have been tasked to read a text file with student grades and perform several operations with them. First, you must read the file, loading the student records. Each record (line) contains the student’s identification number and then four of the student’s numerical test grades. Your application should find the average of the four grades and insert them into the same array as the id number and four grades. I suggest using a 5th...

  • C++

    Q:01: Why do we need functions? Explain your answer by describing the function definition, calling the function, function prototype, and methods of passing variables.Q:02: Write a program to sort the 10 numbers in descending order. For the sorting process, use the function subprogram and display the result in the main function.Q:03: Write a program to store all the alphabets as characters in an array. The program should output:The Entire Alphabets in one line.The first six characters of the alphabet.The last ten characters of...

  • c programming

    Write a c program that reads a string with a maximum length of 30 from the keyboard[1]. The program should then copy the characters from that input string into a second character array (in order of input). However, only if a character is a vowel (a, e, i, o, u) should it be copied into the second array. Once copied, the program should output the values stored in the second array (in order of input). The program should then count...

  • IN C language Write a C program that prompts the user to enter a line of...

    IN C language Write a C program that prompts the user to enter a line of text on the keyboard then echoes the entire line. The program should continue echoing each line until the user responds to the prompt by not entering any text and hitting the return key. Your program should have two functions, writeStr andcreadLn, in addition to the main function. The text string itself should be stored in a char array in main. Both functions should operate...

  • In Java 2. Array Exercise ( 10 points) Write a Java program that will prompt the...

    In Java 2. Array Exercise ( 10 points) Write a Java program that will prompt the user to input a size of an array. Create an array of type int. Ask a user to fill the array. Create a functions sortArray() and mostFrequency(). The sortArray() function will sort number into incrementing order. The sorting function must be implemented from scratch and it must not use any function from the library. Feel free to use any sorting algorithm. The program will...

  • C++ Project - Create a memory game in c++ using structs and pointers. For this exercise,...

    C++ Project - Create a memory game in c++ using structs and pointers. For this exercise, you will create a simple version of the Memory Game. You will again be working with multiple functions and arrays. You will be using pointers for your arrays and you must use a struct to store the move and pass it to functions as needed. Program Design You may want to create two different 4x4 arrays. One to store the symbols the player is...

  • In C Programming Language, write a program Character Pointers and Functions. Keyboard input to enter one...

    In C Programming Language, write a program Character Pointers and Functions. Keyboard input to enter one character string. Using a single dimension array, populate the array with the character string, call a function using pointers to reverse order the character string, pass back to the main the output and total_count_of_characters. (maybe use a global variable for the total count). Print display the reversed char string and total_count.

  • In C Programming Language, write a program Character Pointers and Functions. Keyboard input to enter one...

    In C Programming Language, write a program Character Pointers and Functions. Keyboard input to enter one character string. Using a single dimension array, populate the array with the character string, call a function using pointers to reverse order the character string, pass back to the main the output and total_count_of_characters. (maybe use a global variable for the total count). Print display the reversed char string and total_count.

  • In this program, you will be using C++ programming constructs, such as overloaded functions. Write a...

    In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...

  • Game Description: Most of you have played a very interesting game “Snake” on your old Nokia...

    Game Description: Most of you have played a very interesting game “Snake” on your old Nokia phones (Black & White). Now it is your time to create it with more interesting colors and features. When the game is started a snake is controlled by up, down, left and right keys to eat food which appears on random locations. By eating food snake’s length increases one unit and player’s score increases by 5 points. Food disappears after 15 seconds and appears...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT