Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- while(true) {
- char yn;
- cout << "Iniciar programa? (y or n)" << endl;
- cin >> yn;
- if(yn=='y'){
- double metric_ton, ounces;
- cout << "Type the weight in ounces: ";
- cin >> ounces;
- metric_ton = ounces / 35273.92;
- cout << endl;
- cout << "Weight in metric tons: " << metric_ton << endl << endl;
- cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - -";
- cout << endl << endl;
- }
- else {
- if (yn=='n'){
- break;
- }
- else {
- cout << "Opção não válida, tente novamente" << endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement