? Write a sub-algorithm (subroutine) that given a number N in base 10 and a base value Base between 2 and 10 (inclusive), returns the representation of the decimal value N in the desired Base. For example, given N = 25, and Base = 2, it should return 11001.
Algorithm: Base_10_to_Any_Base
1.0 Given:
1.1 an integer N, a decimal value
1.2 an integer Base, a base between 2 and 10
2.0 Declare variable Result
...

? Write a sub-algorithm (subroutine) that given a string Number representing a number in some base and a base value Base between 2 and 10 (inclusive), returns the representation of Number as a decimal value. For example, given Number = 11001, and Base = 2, it should return 25.
Algorithm: Any_Base_to_Base_10
1.0 Given:
1.1 a string Number, a string of digits,
1.2 an integer Base, a base between 2 and 10
2.0 Declare variable Result
...

? Write an algorithm, that uses the above two sub-algorithms, given a number in some base from and a different base named to, converts the number from the original base to the desired base.
Algorithm: Any_Base_to_Any_Base
1.0 Given:
1.1 a string Number, a string of digits,
1.2 an integer From, a base between 2 and 10
1.2 an integer To, a base between 2 and 10
2.0 Declare variable Result
...

Solution Preview

1. Algorithm: Base_10_to_Any_Base
String Base_10_to_Any_Base(int N, int Base)
BEGIN
1. Define a string str = ""
2. While (N>0) Then
2.1. str = str + (N%Base)
2.2 N = N/Base
End ...

Solution Summary

Sub algorithm base values are examined. The expert declares the results.

Discuss and distinguish between the two primary methods of thinking about problems: algorithms and heuristics. Then suppose that you are going grocery shopping and that you are looking for guava juice. Give examples of both an algorithm and a heuristic procedure that you could use to search for guava juice.

Suppose you are given an array A of n sorted numbers that has been circularly shifted k positions to the right. For example, {35, 42, 5, 15, 27, 29} is a sorted array that has been circularly shifted k = 2 positions, while {27, 29, 35, 42, 5, 15} has been shifted k = 4 positions.
(a) Suppose you know what k is. Give an algori

How would I convert these into flow charts?
Temperature Conversion: "Allow the user to enter a series of temperatures in degrees Celsius (C) terminated by the input of -999. For each one, find the corresponding temperature in degrees Fahrenheit (F). The conversion formula is: F = 9 * C/5 + 32 ".
Factorial: "Find the fact

Write a Java application that performs the following task:
- Create an int array (you can declare the values yourself, or use the Random feature in java to create this array).
- Sort the data.
- Prompt user to input an integer from the keyboard.
- Search for the user input value in the array created in step 1 using a simpl

A store offers 2 models of scooter, a $29 model and a $33 one. An order was placed with a warehouse which totalled $2490 but the details had been lost. Can you tell the order clerk howl many of each model to send to the store?
I have been applying algorithm to equations and am trying to solve integer values for this problem.

C++ program using Microsoft Visual Studio
Sort & Search Evaluation
You are to compare two sorting algorithms and to compare two searching algorithms by running and collecting data on each. Your data for sorting and searching will be strings of 25 characters in length.
The two sorts to compare are the Bubble Sort and th

You are working on a new computer game. One of the implementation problems you are trying to solve is character path finding. The user should be able to select a character and left-click the mouse at a location to have the character move to that new location. Normal movement should send the character along a route with the short

Looking for the solution to these C++ sample problems to assist in understanding the algorithms and steps used to solve these C++ programming problems.