Am frosha and please I need a help with my project
its in microsoft visual C++
1. Theme: Implementing a course related C++ program.
2. Objectives:
a. Have the students to practice programming in C++.
b. Have the students to practice documenting their programs.
c. Have the students to practice numbering conversion.
d. Have the students to practice analyzing the program time complexity.
3. Topic: Implement in C++ a program to solve the following problem:
Covert an integer in base b1 to an integer in base b2, where b1 and b2 are integers and 2≤b1≤10 and 2≤b2≤10.
This is my code
#include <iostream.h>
#include <cmath>
int main()
{int FBase , SBase ,number, counter,n[10],q;
cout << "select the base from 2 to 10 :" ;
cin >> FBase ;
cout << "write the Number which you want to convert : " ;
cin >> number ;
q= 0 ;
counter = 0 ;
while ( number != 0 )
{
q += (number %10 * pow(FBase,counter) );
number = number/10;
counter++;
}
cout << "convert to decimal = " << q << endl;
cout << "select the base to convert " ;
cin >> SBase ;
counter = 0 ;
while ( q != 0 )
{
n[counter] =q % SBase ;
q = q / SBase ;
counter = counter + 1 ;
}
for (counter = counter -1 ; counter >= 0 ; counter--)
cout << n[counter] ;
cout << endl;
system("pause");
return 0 ;
}
I have one ERROR
I realy dont know how to handle it
please also I want to know if its right with the problem or not !!
I realy need to solve this code right
please
Waiting..[u]
** Edit **

New Topic/Question
Reply




MultiQuote




|