// ****************************************************************** // BaseConversion.java // /…

One algorithm for converting a base 10 number to base b involves repeated division by the base b. Initially one divides the number by b. The remainder from this division is the units digit (the rightmost digit) in the base b representation of the number (it is the part of the number that contains no powers of b). The quotient is then divided by b on the next iteration. The remainder from this division gives the next base b digit from the right. The quotient from this division is used in the next iteration. The algorithm stops when the quotient is 0. Note that at each iteration the remainder from the division is the next base b digit from the right-that is, this algorithm finds the digits for the base b number in reverse order. Here is an example for converting 30 to base 4 quotien remaind 7/4 1/4 The answer is read bottom to top in the remainder column, so 30 (base 10) 132 (base 4) Think about how this is recursive in nature: If you want to convert x (30 in our example) to base b (4 in our example), the rightmost digit is the remainder x b. To get the rest of the digits, you perform the same process on what is left: that is, you convert the quotient x/b to baseb. Ifx /bis 0, there is no rest; x is a single base b digit and that digit is x% b (which also is just x) The file BaseConversion java contains the shell of a method convert to do the base conversion and a main method to test the conversion. The convert method returns a string representing the basebnumber, hence for example in the base case when the remainder is what is to be returned it must be converted to a String object. This is done by concatenating the remainder with a null string. The outline of the convert method is as follows: public static String convert (int num, int b) int quotient the quotient when num is divided by base b int remainder the remainder when num is divided by base b quotient. remainder n base case if return else Recursive step: the number is the base b representation of the quotient concatenated with the remainder return Fill in the blanks above (or now dont worry about bases greater than 10, then in BaseConversion java complete the method and main. Main currently asks the user for the number and the base and reads these in. Add a statement to print the string returned by convert appropriately labeled). Test your function on the following input: Number: 89 Base: 2 should print 1011001

// ******************************************************************

// BaseConversion.java

//

// Recursively converts an integer from base 10 to another base

// ******************************************************************

import java.util.Scanner;

public class BaseConversion

{

public static void main (String[] args)

{

   int base10Num;

   int base;

   Scanner scan = new Scanner (System.in);

   System.out.println ();

   System.out.println (“Base Conversion Program”);

   System.out.print (“Enter an integer: “);

   base10Num = scan.nextInt();

   System.out.print (“Enter the base: “);

   base = scan.nextInt();

   // Call convert and print the answer

   System.out.println(base10Num + ” in base ” + base + ” is ” +

           convert(base10Num,base));

}

// ————————————————–

// Converts a base 10 number to another base.

// ————————————————–

public static String convert (int num, int b)

{

   int quotient; // the quotient when num is divided by base b

   int remainder; // the remainder when num is divided by base b

z

   quotient = num / b;

   remainder = num % b;

   // if and else base and recursive case

       …..

}

}

One algorithm for converting a base 10 number to base b involves repeated division by the base b. Initially one divides the number by b. The remainder from this division is the units digit (the rightmost digit) in the base b representation of the number (it is the part of the number that contains no powers of b). The quotient is then divided by b on the next iteration. The remainder from this division gives the next base b digit from the right. The quotient from this division is used in the next iteration. The algorithm stops when the quotient is 0. Note that at each iteration the remainder from the division is the next base b digit from the right-that is, this algorithm finds the digits for the base b number in reverse order. Here is an example for converting 30 to base 4 quotien remaind 7/4 1/4 The answer is read bottom to top in the remainder column, so 30 (base 10) 132 (base 4) Think about how this is recursive in nature: If you want to convert x (30 in our example) to base b (4 in our example), the rightmost digit is the remainder x b. To get the rest of the digits, you perform the same process on what is left: that is, you convert the quotient x/b to baseb. Ifx /bis 0, there is no rest; x is a single base b digit and that digit is x% b (which also is just x) The file BaseConversion java contains the shell of a method convert to do the base conversion and a main method to test the conversion. The convert method returns a string representing the basebnumber, hence for example in the base case when the remainder is what is to be returned it must be converted to a String object. This is done by concatenating the remainder with a null string. The outline of the convert method is as follows: public static String convert (int num, int b) int quotient the quotient when num is divided by base b int remainder the remainder when num is divided by base b quotient. remainder n base case if return else Recursive step: the number is the base b representation of the quotient concatenated with the remainder return Fill in the blanks above (or now don’t worry about bases greater than 10, then in BaseConversion java complete the method and main. Main currently asks the user for the number and the base and reads these in. Add a statement to print the string returned by convert appropriately labeled). Test your function on the following input: Number: 89 Base: 2 should print 1011001

 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Research Proposal Requirement Develop a half to one page proposal that includes the following… 1 answer below »

Research Proposal Requirement

Develop a half to one page proposal that includes the following components:

• A title for the paper (you may revise the title on your full paper, although you should not change the topic)

• An introduction that includes a clear and concise thesis statement; definitions of key terms; and two or three main points that will be detailed in the body of the paper. See writing samples at the end of this document.

• A reference section with at least one quality reference in a standard format (including complete information: title, author(s), time of publication, source of publication, and time retrieved, if applicable)

The reader should come away from your proposal with a clear thesis and two or three main points. That is about all most readers will remember after reading your paper.

Language

Formal, concise, accurate, clear, and grammar and spelling error free.

Imagine that you are working for a company in a small IT group. Your manager has asked you to research a technology and make a recommendation about how your group should, or should not, use the technology. You may pick any topic of current interest in the Information Technology field. Your research will make you the expert in your group on this technology. Your job is to describe the technology to your group and support your conclusions. Your audience includes your peers, who are technically strong, and managers who have some technical background. You must satisfy the needs of both groups. You must explain the technology in terms that the managers can understand while giving enough detail for your peers

Title Blockchain

Document Preview:

Research Proposal Requirement Develop a half to one page proposal that includes the following components: A title for the paper (you may revise the title on your full paper, although you should not change the topic) An introduction that includes a clear and concise thesis statement; definitions of key terms; and two or three main points that will be detailed in the body of the paper. See writing samples at the end of this document. A reference section with at least one quality reference in a standard format (including complete information: title, author(s), time of publication, source of publication, and time retrieved, if applicable) The reader should come away from your proposal with a clear thesis and two or three main points. That is about all most readers will remember after reading your paper. Language Formal, concise, accurate, clear, and grammar and spelling error free. Imagine that you are working for a company in a small IT group. Your manager has asked you to research a technology and make a recommendation about how your group should, or should not, use the technology. You may pick any topic of current interest in the Information Technology field. Your research will make you the expert in your group on this technology. Your job is to describe the technology to your group and support your conclusions. Your audience includes your peers, who are technically strong, and managers who have some technical background. You must satisfy the needs of both groups. You must explain the technology in terms that the managers can understand while giving enough detail for your peers Title Blockchain

 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Why have pensions become a less common form of retirement Why have pensions become a less common…

Why have pensions become a less common form of retirement

Why have pensions become a less common form of retirement benefit offered by companies?

Why have pensions become a less common form of retirement

 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Describe two kinds of paleomagnetic evidence supporting the theory of plate tectonics.

Describe two kinds of paleomagnetic evidence supporting the theory of plate tectonics.
 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

For this Discussion, locate and select two scholarly articles—one article should discuss strategies

For this Discussion, locate and select two scholarly articles—one article should discuss strategies for innovation in strategic planning and one article should discuss strategies for strategic planning in virtual environments. Consider how you might apply these strategies within an organization to effect positive social change.

Post a brief description of the two articles that you selected, including strategic planning strategies for innovation and virtual environments. Explain how you might apply these strategies to effect positive social change.

    • Posted: 4 years ago
    • Due: 11/02/2016
    • Budget: $10
     

    "Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

    Which employee needs in Maslow’s hierarchy or Alderfer’s ERG theory, if any, are met through…

    Which employee needs in Maslow’s hierarchy or Alderfer’s ERG theory, if any, are met through stock-option plans? Explain your answer.
     

    "Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

    how does the parent calculate the noncontrolling interest in a subsidiary company as of the end of…

    how does the parent calculate the noncontrolling interest in a subsidiary company as of the end of a reporting period?

     

    "Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

    Calculate the force in member DJ of the Howe roof truss ilustrated below 10 kN D 10 kN E 6 m F K H.. 1 answer below »

    Calculate the force in member DJ of the Howe roof truss ilustrated below 10 kN D 10 kN E 6 m F K H Y10 KN -6 panels at 4 m- 10.17 kN,T 11.89 KN, C 637 kN, C 16.67 kN, T.

    Attachments:

     

    "Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

    University of Phoenix, Northern Virginia Campus ACC 561 Accounting Course Quiz 1 (Chapters 1, 5, 6)

    University of Phoenix, Northern Virginia Campus

    ACC 561 Accounting Course

    Quiz 1 (Chapters 1, 5, 6)

    Facilitator: Randolph A. Stanley

    Student Name:___________________________

    Grade:__________________________________

    Instructions: Please answer all questions. Each question worth 1point for a total of 25points. You must only select one answer for each question.

    1. _____ refers to accounting information developed for managers
    within an organization.

    a. Internal auditing
    b. Managerial accounting
    c. Financial accounting
    Tax accounting

    2.

    Document Preview:



    University of Phoenix, Northern Virginia Campus
    ACC 561 Accounting Course
    Quiz 1 (Chapters 1, 5, 6)
    Facilitator: Randolph A. Stanley

    Student Name:___________________________

    Grade:__________________________________

    Instructions: Please answer all questions. Each question worth 1point for a total of 25points. You must only select one answer for each question.

    1. _____ refers to accounting information developed for managers
    within an organization.

    a. Internal auditing
    b. Managerial accounting
    c. Financial accounting
    Tax accounting

    2. The primary users of management accounting information are _____.

    a. bankers
    b. governmental regulatory authorities
    c. internal decision makers
    suppliers

    3. The Hola Company held a Christmas party. The company expected attendance of 100 persons and prepared the following budget:

    Hotel room rental $500
    Food 500
    Entertainment 800
    Decorations 400

    Totals $2,200

    After all bills for the party were paid, the total came to $2,315. Details are: $575 for hotel room rental; $640 for food; $750 for entertainment; and $350 for decorations. One hundred persons attended the party.

    What is the total budget variance?

    a. $115 unfavorable is the total budget variance.
    b. $115 favorable is the total budget variance.
    c. $25 favorable is the total budget variance.
    d. $140 unfavorable is the total budget variance.

    4. The Hola Company held a Christmas party. The company expected attendance of 100 persons and prepared the following budget:

    Hotel room rental $600
    Food 500
    Entertainment 800
    Decorations 300

    Totals $2,200

    After all bills for the party were paid, the total came to $2,315. Details are: $575 for hotel room rental; $640 for food; $750 for entertainment; and $350 for decorations. One hundred persons attended the party.

    What is the main reason for the unfavorable total budget variance?

    a. Hotel room rent is the main…

    Attachments:


     

    "Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"