Select a reason you're reporting this job
By joining, you agree to CodeClerks Terms of Service, Privacy Policy, as well as to receive emails.
The largest SEO marketplace in the world
Find all the software to suit your computing needs
Can't find what you're looking for? Create it
Convert cpp code to python and java.
Convert cpp code to python and java
Cpp Python Java
i will convert cpp (c++) file to java as i have an experience of over 3 years in it. samples available on request.
Enter a reason for deleting this comment
traiko
#include <iostream>
using namespace std;
int main() {
bool repeat = true;
while (repeat)
{
int n;
cout << "How many asterisks do you want to print? ";
cin >> n;
for(int star = 1; star <= n; star++)
{
cout << "*";
}
cout << "Repeat? [y/n]" << endl;
char answer;
cin >> answer;
repeat = answer == 'y';
}
cout << "Thank you, goodbye" << endl;
} The code in cpp is:
#include <iostream>
using namespace std;
int main() {
bool repeat = true;
while (repeat)
{
int n;
cout << "How many asterisks do you want to print? ";
cin >> n;
for(int star = 1; star <= n; star++)
{
cout << "*";
}
cout << "Repeat? [y/n]" << endl;
char answer;
cin >> answer;
repeat = answer == 'y';
}
cout << "Thank you, goodbye" << endl;
}
Enter a reason for deleting this comment