subject
Computers and Technology, 11.02.2020 22:04 livj946

Overview This project is designed to give students practice with loops and the Java String class, characters, and arithmetic. Your program will take a hexadecimal or binary number string as an input and print out its decimal value Specification The program will provide a looping menu that invites the user to choose from a menu of number string decoding options. It must provide options to convert hexadecimal and binary into decimal notation for full credit. Proper implementation of a binary to hexadecimal decoding may be added for extra credit: Decoding Menu 1. Decode hexadecimal 2. Decode binary 3. Convert binary to hexadecimal 4. Quit Please enter an option: 1 Based on the user's selection, the program should prompt the user for the appropriate input: Please enter the numeric string to convert: Oxbadfeed ... and should display the result of the string decoding/encoding: Result: 195948557 It should then display the menu again. This should repeat until the program is terminated This project may not make use of existing hexadecimal and/or binary conversion routines built into the Java language and platform, instead, you must do the conversion using your knowledge of binary and hexadecimal numbering systems. However, you may use Java String class methods as well as Math methods. It may be helpful to think of the ASCII values of hexadecimal numbers when working on this project! Program Methods Your program must provide and use the following methods. Each method signature must be match and it must behave as described. Methods should not display anything on the screen! public static Long hexStringDecode(String hex) Decodes an entire hexadecimal string and returns its value. public static short hexCharDecode(char digit) Decodes a single hexadecimal digit and returns its value. public static short binaryStringDecode(String binary) Decodes a binary string and returns its value. public static String binary Totex (String binary) Decodes a binary string, re-encodees it as hexadecimal, and returns the hexadecimal string. NOTE: It is common to display hexadecimal numbers with Ox' as the prefix (eg, the number is represented as Ox. Your program must be able to convert a hexadecimal string into number regardless of whether it is prefixed with 'Ox. Additionally, it must handle the binary prefix "Ob'. It is also common for hex numbers to be typed in lowercase (c. g., OxA ): your program must handle upper- and lower-case letters.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:20
Usually, when we sniff packets, we are only interested certain types of packets. we can do that by setting filters in sniffing. scapy’s filter use the bpf (berkeley packet filter) syntax; you can find the bpf manual from the internet. set the following filters and demonstrate your sniffer program again (each filter should be set separately): (a) capture only the icmp packet. (b) capture any tcp packet that comes from a particular ip and with a destination port number 23. (c) capture packets comes from or to go to a particular subnet. you can pick any subnet, such as 128.230.0.0/16; you should not pick the subnet that your vm is attached to.
Answers: 3
question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
question
Computers and Technology, 23.06.2019 21:50
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
You know the right answer?
Overview This project is designed to give students practice with loops and the Java String class, ch...
Questions
question
Chemistry, 09.02.2021 14:00
question
Mathematics, 09.02.2021 14:00
question
Chemistry, 09.02.2021 14:00
question
Mathematics, 09.02.2021 14:00
question
Advanced Placement (AP), 09.02.2021 14:00
question
Chemistry, 09.02.2021 14:00
Questions on the website: 13722361