1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ale4655 [162]
3 years ago
9

Create and Provide complete program that includes a comments header with your name, course, section and other program details an

d does the following: 1) prompt the user to provide a side of square 2) get side from the user and store it into variable 3) based on the side value calculate perimeter of the square 4) calculate area of the square 5) calculate diameter of the square The program should provide the following output: Enter the side of a square: 12 The perimeter is 48.0 The area is 144.0 The length of the diagonal is 16.97056274847714
Computers and Technology
1 answer:
agasfer [191]3 years ago
7 0

Answer:

Written using C++

/*Enter Your Details Here*/

#include<iostream>

#include<cmath>

using namespace std;

int main()

{

//1

float side;

cout<<"Enter the side of a square: ";

//2

cin>>side;

//3

float perimeter = 4 * side;

cout<<"The perimeter is "<<perimeter<<endl;

//4

float area = side *side;

cout<<"The area is "<<area<<endl;

//5

float diagonal = sqrt(2 * side * side);

cout<<"The length of the diagonal is "<<diagonal;

return 0;

}

Explanation:

<em>I've added the full source code as an attachment where I used more comments to </em><em>explain </em><em>difficult line</em>

Download cpp
You might be interested in
you are packing a mobile phone containing a lithium ion battery and you get a prompt on the screen to put a lithium ion label on
ss7ja [257]

Answer:

<u>Do not use such labels because they may be misleading and are unethical.</u>

Explanation:

Note, there is a<u> big difference in design</u> between the two terms or labels. Lithium metal batteries are <u>non-rechargeable batteries.</u> In other words, they cannot be recharged after they run down. For example, most <em>watches, calculators, or car keys are made of </em>lithium metal batteries.

While Lithium-ion batteries (or Li-ion batteries) are <u>rechargeable batteries</u> , and they are commonly used by<em> mobile phones, laptops, and other gadgets.</em>

<em>Therefore, </em>with such differences in mind, it may be very misleading when someone in possession of the mobile phone sees the lithium metal labels; then thinks the battery is non-rechargeable.

8 0
3 years ago
If any one has mincraft on ps4 bedrock we can finish building a BIG city world all we need to put is a shop and money dispensers
sasho [114]

Answer:

Cool

Explanation:

7 0
3 years ago
Read 2 more answers
What acronym describes networked devices that contain microcomputers but are not thought of as computing devices, such as refrig
vivado [14]
The acronym RFID (Radio Frequency Identification) describes networked devices that contain microcomputers but are not thought of as computing devices, such as refrigerators, automobile components, light bulbs, and industrial control devices. RFIDs are  battery-powered sensors that gather and transmit data to a reading device. Some sensor based technologies are  scanning electron microscopes, LiDAR,radar, GPS, x-ray, sonar, infrared and seismic.



5 0
3 years ago
____ is a linux-based operating system developed by the open handset alliance.
Misha Larkins [42]
The answer is Android
6 0
3 years ago
Write a c program to count the total number of commented characters and words in a c file taking both types of c file comments (
Tanzania [10]

#include<stdio.h>

#include<stdlib.h>

int comment1(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\n')

       {

           return count;

       }

       count++;

   }

   return count;

}

int comment2(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='*')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               return count;

           }

           count++;

       }

       count++;

   }

   return 0;

}

int main()

{

   printf("Enter the file name:");

   char s[1000],ch,ch1;

   scanf("%s",s);

   FILE*fp;

   fp = fopen(s,"r");

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\"')

       {

           while(fscanf(fp,"%c",&ch)!=EOF)

           {

               if(ch=='\"')

               {

                   break;

               }

               if(ch=='\\')

               {

                   fscanf(fp,"%c",&ch);

               }

           }

       }

       else if(ch=='/')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               count += comment1(fp);

           }

           else if(ch=='*')

           {

               count += comment2(fp);

           }

       }

   }

   printf("%d\n",count);

   return 0;    

}

3 0
3 years ago
Read 2 more answers
Other questions:
  • You just turned on a four port Ethernet switch (it hasn’t learned any addresses yet) and connected a host to each port. You send
    8·1 answer
  • What has prompted schools to add Internet activities in their academic integrity policies?
    11·2 answers
  • Which of the following are examples of how a company might use consumer data it had collected? a To decide what types of product
    10·1 answer
  • You buy a new workstation that features an embedded RAID controller on the motherboard. You want to setup hardware RAID 10. How
    10·2 answers
  • Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their chec
    9·2 answers
  • In determining where to store specific data in a(n) centralized DBMS, factors such as communications cost, response time, storag
    12·1 answer
  • The architecture in which the database resides on a back-end machine and users access data through their workstations is
    5·2 answers
  • In what way , if any, can your social media presence affect your chances of getting a job in social media?
    8·1 answer
  • How does computer number system play a Vital role in a computer calculation. ​
    8·1 answer
  • C++ Write a program that initially asks a user to enter two positive integer numbers a and b. If either a or are zero or negativ
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!