Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bookmark C++ Bit Manipulation Program. Please do checkpoint B. Attached are the instructions and program from checkpoint A, which should be similar to that. Thank

Bookmark C++ Bit Manipulation Program. Please do checkpoint B. Attached are the instructions and program from checkpoint A, which should be similar to that. Thank you!

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Checkpoint A (due as an in-person demo by uu Feb 21 at pm Download this C++ program (rgbFromHex.cpp that reads a pixel in hexadecimal format and prints integer values (between 0-255) for R, G, Band A channels. Compile your program on terminal (once you are logged into your blue accounts): g++ -std c++11 rgbFrom Hex.cpp o convertRGB Run your program and sample output: /convertRGB Enter a 32-bit RGBA color value in hexadecimal Ce.g. FF7F3300 2BASE9CD Your color contains: 43 of 255 red 165 of 255 green 233 of 255 blue 205 of 255 alpha Task for checkpoint A: Your task is to write a new C++ program (call itrgbToHex.cpp) that does the opposite of the above program, That is, a program that reads integer values for R, G, B andA and, packs them up in a single 4 byte integer and prints the output in a hexadecimal format. You may assume that, when prompted, the user only enters values between 0-255. Sample output for rgbToHex.cpp Enter a RGBA color value (e.g. 255 127 51 0 26 43 60 77 Your color in hexadecimal is: 1a2b3c4d Enter a RGBA color value Ce.g. 255 127 51 0 205 88 2 95 Your color in hexadecimal is: cd58025f Checkpoint B (due as an in-person demo by Friday March 03 at 3pm): n this phase of the project, you will implement a weapon inventory system for an assassin in a video game Your assassin has the choice of these weapons: None, Melee, Fire, lce and Poison. The assassin may not have any weapons or have multiple weapons at the same time. Your program will store weapon inventory that the assassin possesses at any give time in an uint8 t data type. Let's call the variable myweapon. Checkpoint A (due as an in-person demo by uu Feb 21 at pm Download this C++ program (rgbFromHex.cpp that reads a pixel in hexadecimal format and prints integer values (between 0-255) for R, G, Band A channels. Compile your program on terminal (once you are logged into your blue accounts): g++ -std c++11 rgbFrom Hex.cpp o convertRGB Run your program and sample output: /convertRGB Enter a 32-bit RGBA color value in hexadecimal Ce.g. FF7F3300 2BASE9CD Your color contains: 43 of 255 red 165 of 255 green 233 of 255 blue 205 of 255 alpha Task for checkpoint A: Your task is to write a new C++ program (call itrgbToHex.cpp) that does the opposite of the above program, That is, a program that reads integer values for R, G, B andA and, packs them up in a single 4 byte integer and prints the output in a hexadecimal format. You may assume that, when prompted, the user only enters values between 0-255. Sample output for rgbToHex.cpp Enter a RGBA color value (e.g. 255 127 51 0 26 43 60 77 Your color in hexadecimal is: 1a2b3c4d Enter a RGBA color value Ce.g. 255 127 51 0 205 88 2 95 Your color in hexadecimal is: cd58025f Checkpoint B (due as an in-person demo by Friday March 03 at 3pm): n this phase of the project, you will implement a weapon inventory system for an assassin in a video game Your assassin has the choice of these weapons: None, Melee, Fire, lce and Poison. The assassin may not have any weapons or have multiple weapons at the same time. Your program will store weapon inventory that the assassin possesses at any give time in an uint8 t data type. Let's call the variable myweapon

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions