Question

l. Write a program that displays a Southern version of hello world.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

#include <iostream>

using namespace std;

int main()
{
cout << "Southern Version" << endl; // cout prints on console

return 0;
}

// Output: Southern Version

8.

#include <iostream>
using namespace std;

// this is the method that returns meters for given feet
float convert(int feet)
{
   return feet*0.3048;
}

int main() {
   int i;
   float result; // to store resutl
   printf("Conversion of feet to meters between 10 and 100\n");
   printf("%10s%10s\n", "FEET", "METERS");
  
   // running from 10 to 100 and incrementing by 10 each time
   for(i=10;i<=100;i=i+10)
   {
       // converting to meters and printing
       result = convert(i);
       printf("%10d%10.2f\n", i, result);
   }
   return 0;
}

/* Output

Conversion of feet to meters between 10 and 100
      FEET    METERS
        10      3.05
        20      6.10
        30      9.14
        40     12.19
        50     15.24
        60     18.29
        70     21.34
        80     24.38
        90     27.43
       100     30.48

*/

Add a comment
Know the answer?
Add Answer to:
l. Write a program that displays a "Southern version" of hello world.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT