Concept explainers
Write a
( – –) – –)
Explanation of Solution
Program:
The following program will evaluate the given expression.
//include the header file
#include <stdio.h>
//definition of main method
int main (void)
{
//declare the variable
float ans;
//calculate the ans
ans = (3.31e-8f * 2.01e-7f) / (7.16e-6f + 2.01e-8f);
//display the result
printf ("The answer is %e\n", ans);
//return statement
return 0;
}
Explanation:
In the above program, declare the required header file. Inside the main method, declare the variable. Then calculate the “ans” value and print the result on the output screen.
The answer is 9.266027e-10
Want to see more full solutions like this?
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with C++: Early Objects
Starting Out With Visual Basic (7th Edition)
- Please take screenshots of the stops. (Science: calculating energy) Write a program that calculates the energy needed to heat water from an initial temperature to a final temperature. Your program should prompt the user to enter the amount of water in kilograms and the initial and final temperatures of the water. The formula to compute the energy is Q = M * (finalTemperature – initialTemperature) * 4184 where M is the weight of water in kilograms, temperatures are in degrees Celsius, and energy Q is measured in joules.arrow_forwardWrite TRUE if the output of the expression is true and FALSE if the output of the expression is false.arrow_forward(The last term is supposed to be an )arrow_forward
- Given a and b are int variables and c is a double variable. The initial value for a, b, and c are 8, 4, and 2.5. Show the working steps and result for the following expression:(i) a + b++ - carrow_forwardSimplify the following expression as much as possible ? *arrow_forwarduse following code to solve the question : Program Specifications Write a program to play an automated game of Rock, Paper, Scissors. Two players make one of three hand signals at the same time. Hand signals represent a rock, a piece of paper, or a pair of scissors. Each combination results in a win for one of the players. Rock crushes scissors, paper covers rock, and scissors cut paper. A tie occurs if both players make the same signal. Use a random number generator of 0, 1, or 2 to represent the three signals.Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.Step 0. Read starter template and do not change the provided code. Integer constants are defined for ROCK, PAPER, and SCISSORS. A seed is read from input to initialize the random number generator. This supports automated testing and creates predictable results that would otherwise…arrow_forward
- PROBLEM:Write a program that prompts the user to input any digit then swap the position of the first and the last digit. Next, the user will be prompt to select what arithmetic operation he/she want to employ on the first and last digit based on the following choices: 1. Sum of their square 2. Product of their square root 3. Square of their product The output will display the result of the arithmetic operation followed by the digit with a swapped position of “first” and “last” digit. Then finally display the equivalent uppercase alphabet for the first digit and lowercase alphabet for the last digit respectively after swapping. Note: 1. If the last digit of the inputted digit from the user is zero, it must display that there is no equivalent alphabet for that digit. 2. If the user chooses arithmetic operation No.2, format the output to three decimal placesarrow_forwardWrite a program that does the following: 1) Set u=6.3 without displaying and a = 84 In(u + 1) degrees. b = 5 2) Compute cos(a)Vu by calculating the denominator first. (Use long format).arrow_forwardWrite a program using nested loop structures that displays the following output. Please answer using java nested loopsarrow_forward
- (Display a pattern) Write a program that displays the following pattern:FFFFFFF U U NN NNFF U U NNN NNFFFFFFF U U NN N NNFF U U NN N NNFF UUU NN NNNarrow_forwardGive proper explanation Write a shell scrip program to prompt the user to enter a negative integer for: m and displays the sum of all the odd integers in the range m to 0 inclusive. For the sake of simplicity assume the user enters a negative integer. For example, if the user enters -5 for m the display output is: -9arrow_forwardQuestion: Run a program that checks whether the number is even or oddarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning