Activity 4: Write a C program to compute the area and circumference of a circle, take the radius as input from user, calculate the radius and the area, Display the resulting values on the console. The program should define the value of pi (n) as constant.
Q: ) Write a c++ calculator program using state switch prod, sum, diff, The remainder of the division.
A: PROGRAM CODE: # include <iostream>using namespace std; int main(){ char op; int num1,…
Q: Write a program in C to add two complex numbers.
A: Required: Write a program in C to add two complex numbers.
Q: 1. Write a C++ program that prompts the user to input four integer values and the computer will…
A: #include<iostream>using namespace std;int main(){ int minno,p,q,r,s; cout<<"enter…
Q: Write a C++ program to display fireworks in a ring shape using asteriks (*). Loops, arrays,…
A: The required c++ code is:…
Q: Q3: b-Write a program in (Fortran 95) to find the value of W from the following equations. If X is…
A: We need to write a Fortran 95 code for the given scenario.
Q: Question 2.2 Write a c++ program to generate 10, 2 digit random numbers and print all the numbers,…
A: here have to determine about c++ code for print 10 random number and max of them.
Q: 15 Write a C++ program that displays the results of the expressions 3.0*5.0.7.1*8.3- *.2.2, and…
A: #include <iostream> using namespace std; int main(){ float expr1,expr2,expr3; expr1…
Q: Run the following C++ program. Assume that user enters these numbers (8,101,46,57). What is the…
A: The program prints the value of “counter” which is 332 as its output. Explanation: Input: 8 The…
Q: Q.3 Write a C++ program that calculates the volume of a solid cone. The formula is: volume = ((0…
A: Formula of volume of sphere: (πr2h)/3 Below is the required code in C++. Program Approach: Include…
Q: 46- Identify the correct function from which the execution of C++ program starts? * • New() •…
A: Identify correct function from which execution of c++ program starts
Q: Write a C program that displays the differences between the first and last, the second and next to…
A: #include <stdio.h> int main(void) { int n=10; int a[10]={87, 45, 23, 56, 12, 4, 34, 77,…
Q: 5- Write a C++ program to display your University name at one line at screen.
A: first take input from user for the name of university using cin. after that you can use cout…
Q: Create a C program with a code of a Basic Calculator that will take an input(s) and perform the…
A: C Program to create simple calculator is given in step 2
Q: 1. Code, compile and execute a C++ program that calculates and displays (including the table) the…
A: Here is Your Code #include <iostream> using namespace std; int main(){ float x; int…
Q: Create a c++ program to swap the values of two variables entered by user then display the swapped…
A: As per the requirement program has completed. Algorithm Step 1: Write the main() method Step 2:…
Q: 2-Write a C++ program to swap two numbers using pointers and functions. How to swap two numbers…
A: Given: Write a C++ program to swap two numbers using pointers and functions. How to swap two…
Q: 1. Write a complete C++ program to prompt a user to enter the working hours and rate per hour.…
A: Given Total_salary=working hours* rate per hours To write c++ program to calculate total salary
Q: In the C programming language, write a program to input the radius of a sphere and display the…
A: C program: #include <stdio.h>#define PI 3.14 int main(){ float radius, SurfaceArea, Area;…
Q: Write a C program that takes a command line argument of a number that you need to calculate the…
A: The command-line argument is a parameter passing technique to the program when it is invoked. It…
Q: Project 6: You have to create a program in C language in which the user enters the mass m and radius…
A: Moment Of Inertia for a Circular Disc: The tendency of a body to resist change or moment of inertia…
Q: B) R1= 20, R2-40 resistors are connected in series and R3-120, R4-40 resistors are connected in…
A: Here, we have given a Circuit Diagram , with 4 resistances R1 , R2 , R3 , R4 and Voltage V. We have…
Q: Design by C++ Using subroutines (VOID) write a program to perform numerical integration of…
A: Solution :: Let's see first what is C++ ? Answer :: C++ is a cross-(raised, flat supporting…
Q: 5. Write a C++ program that prompts the user to input the x-y coordinate of a point in the Cartesian…
A: code:
Q: Activity 3 2.) Write a C program that Enters 2 numbers and print them out. Then print the next 10…
A: EXPLANATION: - The user is given the prompt and two numbers(integers) are read using the scanf…
Q: Run the following C++ program. Assume that user enters these numbers (8,101,46,57). What is the…
A: The value of the variable “counter” is according to given numbers at the end of the program will be…
Q: In C programming language, write a program to input the radius of a sphere and display the…
A: In the C programming language, write a program to input the radius of a sphere and display the…
Q: Design and write a C program that performs the following functionality: 1. Prompt the user for a…
A: #include <stdio.h> int main(){ int n; char c; printf("Enter NumberOf Rows And…
Q: 1.8 Create a C++ program in which the user enters the work done W by a force and the time taker and…
A: The power is defined as the work done per unit interval of time
Q: Design by C++ Using subroutines (VOID) write a program to perform numerical integration of…
A: Step 1 The answer is given in the below step
Q: 1- write a c program to process weekly employee time cards for all employees of an organization…
A: As per the guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: Question 1 ( According to your understanding of C, fill in the blanks with an expression or a…
A: C program: C is the general purpose programming language. It was developed by Dennis Ritchie at AT…
Q: 1. Write a program in C. It is required to compute the area of a triangle. The sides of the triangle…
A: Answer: Pseudo Code: startmainvariables float b,h, areaprint Enter the base of the triangleread…
Q: Q2) Write a C++ program to display the memory size that should be allocated to the (integer,…
A: The C++ program to display the memory size that should be allocated to the (integer,character and…
Q: Q: Write a C program to calculate the perimeter and area of a rectangle in which user inputs the…
A: Given : Formula:• Perimeter of a rectangle = 2(height + Width) square units• Area = Width x height
Q: 21: Write a C++ program to calculate the diagonal of a rectangle. Users are required to enter Ehe…
A:
Q: Design and write a C program that performs the following functionality: . Prompt the user for a…
A: Given :
Q: 5. Write a C+ program that accepts a user-entered number and calculates the square root . Before…
A: Given To calculate square root for the number. Before calculating checking the number is negative or…
Q: Q.4 Write a C++ program to generate the screen output shown below (assume the rectangle is the…
A: Below is the required C code. Approach of Program: Include a necessary header files and use a…
Q: Design and write a C program that performs the following functionality: 1. Prompt the user for a…
A: code: #include <stdio.h>int main() { int i, j, rows; char st; printf("Enter the number…
Q: ii) Write a C program to calculate and display the acceleration due to gravity at the surface of the…
A: #include <stdio.h>#include <math.h> int main() { double g; /* declare variable to…
Q: Design and write a C program that performs the following functionality: 1. Prompt the user for a…
A: Required:
Q: Write a program in C to display the cube of the number up to given an integer.
A: #include<stdio.h> int main() { int number, cube; printf(" \n Please Enter any integer…
Q: iv. Write a C++ program that inputs current day and month from the user. It then calculates and…
A: Programme : #include<iostream>using namespace std;int main(){ int n=0,d,m,y; int…
Q: 3) Write a C++ program that stores the variable length and the variable width. Have your program…
A: Algorithm: 1. Start. 2. Read the value for length and width variable. 3. Calculate the value for…
Q: Consider the simple electric circuit above. Write a C program that calculates the current through…
A: Program Plan/Algorithm: Include the header file stdio Define the macro VOLTAGE to 24 Create a main…
Q: B) R1= 20, R2=40 resistors are connected in series and R3-120, R4=40 resistors are connected in…
A: First of all we would derive some formulas to use in our C++ code, We have to find Currents…
Q: Design and write a C program that performs the following functionality: . Prompt the user for a…
A: the c code is an given below :
Q: Run the following C++ program. Assume that user enters these numbers (8,101,46,57). What is the…
A: PROGRAM: //Header file #include <iostream> //Using namespace using namespace std; //control()…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- (Conversion) a. Write a C++ program to convert meters to feet. The program should request the starting meter value, the number of conversions to be made, and the increment between metric values. The display should have appropriate headings and list the meters and the corresponding feet value. If the number of iterations is greater than 10, have your program substitute a default increment of 10. Use the relationship that 1 meter = 3.281 feet. b. Run the program written in Exercise 6a on a computer. Verify that your program begins at the correct starting meter value and contains the exact number of conversions specified in your input data. c. Modify the program written in Exercise 6a to request the starting meter value, the ending meter value, and the increment. Instead of the condition checking for a fixed count, the condition checks for the ending meter value. If the number of iterations is greater than 20, have your program substitute a default increment of (ending value - starting value) / 19.In C++ Read and understand the following problem: 1. Write a program that accepts from the user a unit price of a certain product and the quantity of that product bought by a customer. It should compute and display the amount payable.Write a C++ program of the following statements: part a: Write a C++ program that takes 4 integer variables and prints its addresses. Part b: Write a C++ Program to assign data to members of a structure variable and display it.
- C Language - Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies.Write a C program Test, Debug and execute the C program Write a program that creates a function multiple that determines if the integer entered from a keyboard is a multiple of some integer x.Write a C++ program to add two fractions and display the result fraction. Your program willprompt the user to input fraction 1 and fraction 2. The numerator and denominator of each fractionare input separately by space. You will need to use a C++ class to define a fraction. The class hastwo members: numerator and denominator. Use function Sum for calculating fraction.
- Run the following C++ program. Assume that user enters these numbers (8,101,46,57). What is the value of variable “counter” according to these numbers at the end of the program? #include <iostream> using namespace std; int control (int counter, int num) { switch (num) { case 0:counter = counter + 2; break; case 1:counter = counter + 3; case 2:counter *= 4; break; case 3:counter--; } return counter;} int main (){ int num; int count = 10; int counter = 0; while (count > 0) { cout << "Enter a number" << endl; cin >> num; num = num % 4; counter = control (counter, num); count -= 3; } cout << counter << endl; return 0; }A C++ program that inputs the names and monthly salaries of 10 employees. The programchecks annual salary of each person. If annual salary is greater than or equal to Rs. 250000/-then it prints name, salary and a message ‘Tax to be paid’ else it prints name, salary and amessage ‘No tax’. Using pointers.In C, write two preprocessor directives and explain them.
- Design and write a C program that performs the following functionality: 1. Read your student number on the command line when you call the program executable. Example: testq1.exe 201314493 2. Check if sufficient number of input arguments have been entered. 3. If insufficient number of input arguments have been entered, write an error message and exit the program by returning minus (negative) one (-1); 4. Copy the student number into a string array and determine its length. 5. Prompt the user for their first and last name. Store these values. 6. Loop through each number in the student number and determine if the digit is even or odd. For example, in the above example, the first and second digits are even (20), and the third and fourth digits are odd (13). 7. If the number is even, then convert the number to the next odd number. For example, if the number is 2, then add one to the number to make it an odd number, 2+1 = 3. 8. Hint: check the remainder to determine if a number is even (0)…Explain the following functions in a c program fscanf(), fprintf(), fgets(), fputs(),fread(),fwrite(), feof()EXPLAIN THIS C++ PROGRAM STEP BY STEP DETAIL WITH LOGIC #include<iostream> using namespace std; class Circle{int x,y;int r;static int number_of_circles;public:Circle(int a , int b, int rad){x = a;y = b;r = rad;++number_of_circles;}Circle(const Circle &c1){x = c1.x;y = c1.y;r = c1.r;number_of_circles = ++c1.number_of_circles; }void display(){cout<<"Co-ordinates : ("<<x<<" , "<<y<<" ) \n";cout<<"Radius : "<<r<<"\n";}friend void update(Circle &c);static int update_number_of_circles(){return number_of_circles;}};void update(Circle &c){int a,b,rad;cout<<"Enter the coordinates of the centre : ";cin>>a>>b;cout<<"Enter the radius of th circle : ";cin>>rad;c.x = a;c.y = b;c.r = rad;}int Circle::number_of_circles = 0; int main(){Circle c(1,2,5);Circle c1(c);Circle c2(c1);c1.display();update(c1);c1.display();cout<<c2.update_number_of_circles(); } #include<iostream> using namespace std;…