Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

psuedo code would be great Suppose I the cable company represents the channels your TV has access to with a 64-bit integer. Each channel from

image text in transcribed

psuedo code would be great

Suppose I the cable company represents the channels your TV has access to with a 64-bit integer. Each channel from 0 to 63 is represented by one bit, where 1 means the channel is enabled and 0 means the channel is disabled. Assume channel 0 is the least significant bit. When you get your cable box, the technician sets the 64-bit code. long A = enabledChannels(); Write code (pseudocode or Java is fine) for the following tasks. You may not call any "magic" library functions, rather you should just use basic operations like if, for, while, the bitwise operations (~, &, >, |, ^) and integer operations, like ==, . a. A function that returns whether a particular channel (integer 0-63) is enabled, boolean is Enabled(long A, int channel) {...} b. A function that returns a new integer, with the given channel enabled, long enableChannel(long A, int channel) {...}

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

Students also viewed these Databases questions