Question

Exercises (No programming is required. Your submission should be a word or pdf document.) Question 1: (3 Marks) Convert from binary the number (11081181), to decimal and show all steps. Question 2: (3 Marks) Convert from decimal (350)e to binary and show all steps Question 3: (3 Marks) Convert from decimal (3567)s to hexadecimal and show all steps. Question 4: (3 Marks) Convert from hexadecimal (45AC)s to octal and show all steps Question 5: (2 Marks) Given the following snippet of code, how many times the code outputs the sum of i, J, and k for (int i- e; i<10; i++) for (int j- ; j<1e;j+) for (int k e; k<10; k) Programming: 1. Program 1: (6 Marks 4 marks for the program and 1 mark for each screenshot) Write a program that prompts the user to enter an integer number n, and outputs the terms of a sequence defined by the division of n by 3 until the quotient is equal to zero For instance, if the user enters n 27, the programs should output the following terms: 27/39 9/3 3 3/3 1 /30 Hint use do-while loop Note Your submission should include a cop file and 2 screenshots of the execution of the program using each of the values:n-98 n 999)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please ask 1 question at a time, although i have done the first 2.
Question 1:
(11001101) to decimal:

=> 1 * 27 +1 * 26 + 0 * 25 + 0 * 24 + 1 * 23 + 1 * 22 + 0 * 21+1*20

\Rightarrow 207

Question 2

350 to binary

Division by 2 Quotient Remainder
350/2 175 0
175/2 87 1
87/2 43 1
43/2 21 1
21/2 10 1
10/2 5 0
5/2 2 1
2/2 1 0

Moving from bottom to top :

(350)_{10}= (10101110)_2

Add a comment
Know the answer?
Add Answer to:
Exercises (No programming is required. Your submission should be a word or pdf document.) Question 1:...
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
  • CS 3503-06 Homework 1 Due: 11:59pm, Friday, Jan. 24. Please show the details of your work....

    CS 3503-06 Homework 1 Due: 11:59pm, Friday, Jan. 24. Please show the details of your work. Please submit in D2L using the associated link. Problems (total: 100 points) Representation of signed numbers (5 x 4 = 20 points) In an 8-bit system, find out the binary representation for the following numbers using sign-and-magnitude, ones’ complement, and two’s complement, respectively: 55 -47 In a 4-bit system, find out the binary representation for the following numbers using sign-and-magnitude, ones’ complement, and two’s...

  • Write a Java program to convert octal (integer) numbers into their decimal number equivalents (exactly the...

    Write a Java program to convert octal (integer) numbers into their decimal number equivalents (exactly the opposite of what you have done in Assignment 4). Make sure that you create a new Project and Java class file for this assignment. Your file should be named “Main.java”. You can read about octal-to-decimal number conversions on wikepedia Assignment 4 is at the bottom Objective Your program should prompt the user to enter a number of no greater than 8 digits. If the...

  • 1. BINARYTODECIMAL,OCTAL(QUICK),ANDHEXADECIMAL(QUICK) The binary value you will be converting from will be derived from your Student...

    1. BINARYTODECIMAL,OCTAL(QUICK),ANDHEXADECIMAL(QUICK) The binary value you will be converting from will be derived from your Student ID (SID). Take each decimal digit of your SID and assign a “1” above it in the corresponding column on the “Binary Value” row below. If a “1” is already present from a past duplicate digit, keep it as a “1”. Place 0’s in any of the remaining empty columns of the “Binary Value”. You should now have a 10 digit unique binary value...

  • b) Convert the following numbers. (Please show all steps; no marks will be awarded if no...

    b) Convert the following numbers. (Please show all steps; no marks will be awarded if no steps are shown) i) 0xAD9 into 3-base representation ii) 4518 into 2-base (binary) representation iii) 123.35 into octal representation (up to 3 octal points) iv) 14.358 into decimal representation

  • write codes and give detailed explanation of how to execute. What you need to turn in:...

    write codes and give detailed explanation of how to execute. What you need to turn in: You will need to include an electronic copy of your report (standalone) and source code (zipped) of your programs. All programming files (source code) must be put in a zipped folder named "labl-name," where "name" is your last name. Submit the zipped folder on the assignment page in Canvas; submit the report separately (not inside the zipped folder) as a Microsoft Word or PDF...

  • write programs with detailed instructions on how to execute. code is java What you need to...

    write programs with detailed instructions on how to execute. code is java What you need to turn in: You will need to include an electronic copy of your report (standalone) and source code (zipped) of your programs. All programming files (source code) must be put in a zipped folder named "labl-name," where "name" is your last name. Submit the zipped folder on the assignment page in Canvas; submit the report separately (not inside the zipped folder) as a Microsoft Word...

  • Please answer the above queston (in terms of C programming) and explain answer Semester 2 &...

    Please answer the above queston (in terms of C programming) and explain answer Semester 2 & Trimester 3B, 2015 COMP1004 Engineering Programming Question 3 - Repetition (20 marks) Q3(a) What will be printed when the following code is executed? (5 marks] #include <stdio.h> int main() int i, j; for(i=1;i<17;i=i+2) { printf("%d==", i); for(j=i; j>0;j--) printf("#"); printf("\n"); return 0; == # 3 = = # # # 5 == ### ## 7 #### #

  • Question One (2 marks): What is the complexity of the given code as a function of the problem size n? Show the (complete) details of your analysis. Note: a [ i] s an array with n elements. for (int i...

    Question One (2 marks): What is the complexity of the given code as a function of the problem size n? Show the (complete) details of your analysis. Note: a [ i] s an array with n elements. for (int i- 0; i < n; i++) if (Math.random) > 0.5) if (i%2-0) Insertionsort (a[i]); else Quicksort (a[i]) else for (int j = 0; j < i; j++) for (int k 0: k 〈 i; k++) o (logn) Question One (2 marks):...

  • Need help in c++ programming to output the lines in my code: if word if found:...

    Need help in c++ programming to output the lines in my code: if word if found:            cout << "'" << word << "' was found in the grid" << endl;            cout << "'" << word << "' was not found in the grid" << endl; The words can be touching if they are horizontally, vertically, or diagonally adjacent. For example, the board: Q W E R T A S D F G Z X C V B Y U A...

  • What to submit: your answers to exercises 1, 3, and 4 and separate the codes to...

    What to submit: your answers to exercises 1, 3, and 4 and separate the codes to each question. Using your solution to question 3 of Lab Practice 2, modify it to create a class that contains a static method; the method takes a string as a parameter and returns a boolean value indicating whether the parameter string has repeated characters in it or not. That is, return true if there is at least one character which appears more than once...

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