Concept explainers
According to the Coulomb force law, the electric force between two charged particles of charge Q1 and Q2 Coulombs, that are a distance r meters apart, is
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Big Java Late Objects
Additional Engineering Textbook Solutions
Modern Database Management (12th Edition)
Experiencing MIS
Data Structures and Algorithms in Java
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
- Using Paython Write a program that asks a student for his grade (out of 100) in 3 exams and then print out his final grade (out of 100), given that the weight of the first exam is 30%, the second 30%, and the third 40%.Example Input:Exam1: 70Exam2: 80Exam3: 90Example Output:Total Grade = 81Explanation: 0.3 * 70 + 0.3 * 80 + 0.4 * 90 = 81arrow_forwardJavaarrow_forwardIn Python A soup company is interested in finding out how much of their soup will go into various sized cans. The user will input the diameter of the can end, and the height of the can. The volume of a cylinder is the well known formula: volume = area of the ends * height of cylinder. The twist is that a can of soup can not be completely filled to the top; only 95% of the volume can be filled with soup; the remaining 5% must remain empty to allow for expansion. NOTE: when computing the area, use pi to at least 5 significant digits (eg, 3.14159) or use the constant math.pi. You should define a function named soup_volume which takes two parameters, the diameter of the can in cm, and the height of the can in cm, in that order. The function should return a float value, which is the volume of soup that the can is able to hold. The function should not round the value, but when printing the value in the main program, format it to show only 2 decimal places. Example run of the program: Enter…arrow_forward
- The area of a hexagon can be computed using thefollowing formula (s is the length of a side): Write a program that prompts the user to enter the side of a hexagon and displaysits area. Here is a sample run: Enter the side: 5.5 ↵EnterThe area of the hexagon is 78.59arrow_forwardA bullet train slows from a speed of 200 mi/hr to 150 mi/hr in one minute. Write a computer program that calculates the bullet train’s constant rate of acceleration and determines how long the bullet train will take to come to rest, given an initial speed of 200 mi/hr. (Hint: Use the equation a = vf - vi t where a is acceleration, t is time interval, vi is initial velocity, and vf is final velocity.) Write and call a function that displays instructions to the program user and a function that computes a, given t, vf, and vi. using c programming languagearrow_forwardYou are asked to write a program that calculates your electric bill. You are to input the numberof kilo-watt hours (kWh) used in a 31 day billing period. Electricity costs 6.72 cents per kWh; atax of 8% should be added. Write a program that accepts the number of kilo-watt hours usedand prints a bill.Sample Run:Please enter the kilo watt hours over 31 days: 412Electric bill for a 31 days period is as follows:Number of Kilo Watt hours: 412.0Amount: $27.6864 Tax: $2.214912Total: $29.901311999999997arrow_forward
- Write a program that reads an integer and displays its first five multiples. For example, if the input integer is 10, the output should be as follows: 10, 20, 30, 40, 50.arrow_forwardWrite a program that computes the theoretical flame temperature when a mixture of methane, propane, n-butane, and n-pentane (0% to 100% mole methane in 5 % increments; 0 to 100 mol% propane in 5% increments; 0% to 100% mole n-butane in 5 % increments) at 25°C is burned with excess air (0% to 100% excess in 5% increments) preheated to preheated to (50°C to 200°C in 10°C increments)arrow_forwardAirline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönderarrow_forward
- Write a program to calculate the position of a projectile at a given time t. For an initial velocity vo and angle of departure ®g, the position is given by x and y coordinates as follows (note: the gravity constant g is 9.81 m/s²): X= V0 Cos (0)t y=vo sin (8,)t –; gt The program should initialize the variables for the initial velocity, time, and angle of departure. It should then call a function to find the x and y coordinates, and then another function to print the resultsarrow_forwardWrite a program that generates a random integer N between 0 and 20 (included). Then it will ask the user continuously to enter a value V between O and 20. • If the V is equal to N the program displays "you win!!" and ends • If the difference between V and N is equal or greater than 12 the program dispiays "Very Cold" • If the difference between V and N is less than 12 and equal or greater than 6 the program displays "Cold" • If the difference between V and N is less than 6 and equal or greater than 3 the program displays "Hot" • if the difference between V and N is less than 3 the program displays "Very hot" The program ends if the user guess the correct number or if he enters 10 wrong numbers. If the user enters 10 wrong numbers the program displays "You lost" and the correct number. Hint: To compute the difference between V and N use Math.abs(V-N) Using java Runi Enter a number between 0 and 20:5 Very hot Enter a number between 0 and 20: 10 Run2 Enter a number between O and 20: 15…arrow_forwardYou arrive in front of a bridge that you must cross to reach a village before dark. Crossing the bridge is not free - the bridgekeeper asks you to roll two dice to determine the cost. You decide to write a program to verify that he is charging the right price. Your program should read two integers, between 1 and 6, representing the values of each die. If the sum is greater than or equal to 10, then you must pay a special fee (36 coins). Otherwise, you pay twice the sum of the values of the two dice. Your program must then display the text "Special tax" or "Regular tax" followed by the amount you have to pay on the next line.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr