Question

Design and write a program which covers a minimum of ANY SIX (6) of the following...

Design and write a program which covers a minimum of ANY SIX (6) of

the following items. (( C++ ))

1) Variable(s)

2) Escape sequence(s)

3) Assignment statement(s)

4) Initialization statement(s)

5) Comment statement(s)

6) cin function(s) to read user input

7) Expression(s)

8) Any function(s) from the iomanip library.

9) Any function(s) from the cmath library.

10) Constant variable(s)

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

What does my program does is ... it read the radius which is given by user and return Area and Circumference of Circle

I have used

1) Variable(s) // r, area, circum,pi

2) Escape sequence(s) // \n

3) Assignment statement(s) //  area = pi * pow(r,2); circum = 2 * pi * r;

5) Comment statement(s) // comment

6) cin function(s) to read user input // read radius r

7) Expression(s) //  area = pi * pow(r,2); circum = 2 * pi * r;

9) Any function(s) from the cmath library. //pow

10) Constant variable(s) // pi

Here is code:

#include<iostream>
#include<cmath> // pow()
using namespace std;
int main()
{
// declaring 3 variable of float r, area, circum
   float r, area, circum;
   //contant variable pi
   const float pi = 3.14;
   cout<<"Enter the radius of the circle :";
   //read radius of circle using cin
   cin>>r;
   //using cmath(pow), calculation the power r square 2 and assigning to area variable
   area = pi * pow(r,2);
   circum = 2 * pi * r;
   //printing the area variable area and circum and for print new line \n escape sequence is used
   cout<<"Area of the circle = "<<area<<"\nCircumference of the circle = "<<circum<<"\n";
   return 0; // return 0 to main end exit
}

Output:

Enter the radius of the circle :2 Area of the circle 12.56 Circumference of the circle 12.56

Add a comment
Know the answer?
Add Answer to:
Design and write a program which covers a minimum of ANY SIX (6) of the following...
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
  • Project 1, Program Design 1. Write a C program replace.c that asks the user to enter...

    Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....

  • Reverse.cpp Write a program that reads in a series of positive integers terminted by a -1,...

    Reverse.cpp Write a program that reads in a series of positive integers terminted by a -1, e.g.           73 95 61 21 90 85 14 78 -1 The values should be stored in an array.   The program then prints the values in reverse order as well as the average (to one decimal place). For example, Please enter the integers: 73 95 61 21 90 85 14 78 -1 The values in reverse order are         78   14   85   90   21...

  • In c++ programming, can you please edit this program to meet these requirements: The program that...

    In c++ programming, can you please edit this program to meet these requirements: The program that needs editing: #include <iostream> #include <fstream> #include <iomanip> using namespace std; int cal_avg(char* filenumbers, int n){ int a = 0; int number[100]; ifstream filein(filenumbers); if (!filein) { cout << "Please enter a a correct file to read in the numbers from"; }    while (!filein.eof()) { filein >> number[a]; a++; } int total = number[0]; for (a = 0; a < n; a++) {...

  • AA. Final Project - Improved JavaFX GUI Personal Lending Library Description: In this project we will...

    AA. Final Project - Improved JavaFX GUI Personal Lending Library Description: In this project we will improve our personal lending library tool by (1) adding the ability to delete items from the library, (2) creating a graphical user interface that shows the contents of the library and allows the user to add, delete, check out, or check in an item. (3) using a file to store the library contents so that they persist between program executions, and (4) removing the...

  • This is for C++ Write a program that reads in a sequence of characters entered by...

    This is for C++ Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along with the number of times it occured. All non-alphabetic characters must...

  • This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to...

    This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to Using Individual Variables One of the main advantages of using arrays instead of individual variables to store values is that the program code becomes much smaller. Write two versions of a program, one using arrays to hold the input values, and one using individual variables to hold the input values. The programs should ask the user to enter 10 integer values, and then it...

  • Object oriented design: Write a program that implements the basic flow, the startup scenario (For a retail store) a...

    Object oriented design: Write a program that implements the basic flow, the startup scenario (For a retail store) and the alternative flow: An item with the specified identifier has already been entered in the current sale. Program increases the sold quantity of the item, and presents item description, price, and running total. You do not have to program any other alternative flows or add any other functionality. You are also not required to code the view, you may replace the...

  • Develop a flowchart and then write a menu-driven C++ program that uses several FUNCTIONS to solve...

    Develop a flowchart and then write a menu-driven C++ program that uses several FUNCTIONS to solve the following program. -Use Microsoft Visual C++ .NET 2010 Professional compiler using default compiler settings. -Use Microsoft Visio 2013 for developing your flowchart. -Adherence to the ANSI C++  required -Do not use <stdio.h> and <conio.h>. -Do not use any #define in your program. -No goto statements allowed. Upon execution of the program, the program displays a menu as shown below and the user is prompted to make a selection from the menu....

  • //Done in C please! //Any help appreciated! Write two programs to write and read from file...

    //Done in C please! //Any help appreciated! Write two programs to write and read from file the age and first and last names of people. The programs should work as follows: 1. The first program reads strings containing first and last names and saves them in a text file (this should be done with the fprintf function). The program should take the name of the file as a command line argument. The loop ends when the user enters 0, the...

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