Concept explainers
(Hard drive storage capacity) If you buy a 40 GB hard drive, then chances are that the actual storage on the hard drive is not 40 GB. This is due to the fact that, typically, a manufacturer uses 1,000 bytes as the value of 1K bytes, 1,000 K bytes as the value of 1 MB, 1,000 MB as the value of 1 GB. Therefore, a 40 GB hard drive contains 40,000,000,000 bytes. However, in computer memory, as given in Table 1-1 (Chapter 1), 1 KB is equal to 1,024 bytes, and so on. So the actual storage on a 40 GB hard drive is approximately 37.25 GB. (You might like to read the fine print next time you buy a hard drive.) Write a
Trending nowThis is a popular solution!
Chapter 2 Solutions
C++ Programming: From Problem Analysis to Program Design
- write a code that decodes the coloured bands on a resistor.Each colour band printed on a resistor has a corresponding numeric value, as shown in the table below: Colour Numeric value black 0 brown 1 red 2 orange 3 yellow 4 green 5 blue 6 violet 7 grey 8 white 9 To calculate the total resistance value, the following formula should be used: resistance=(10a+b)⋅10^c where a, b, and c are the numeric values of the first, second, and third colour bands respectively. For example, let's say that the colour bands on a resistor are red-green-orange. In this case, a=2, b=5, and c=3 (using the table). Hence the resistance value is 25000 ohms: resistance=(10*2+5)⋅10^3=25000 ohms Your task is to write a program which asks the user to input the three colour bands. The program should then calculate and output the resistance value indicated by the bands. As part of your solution, you must define and use a function named colour_to_number. This function should take one…arrow_forwardPlease answer this, Thank you!arrow_forwardProgramming Language: use Python pleasearrow_forward
- Toject Yourld). Problem: The nuclear binding energy is the energy required to split a nucleus of an atom in its component parts: protons and neutrons, or, collectively, the nucleons. It describes how strongly nucleons are bound to each other. When a high amount of energy is needed to separate the nucleons, it means nucleus is very stable and the neutrons and protons are tightly bound to each other. + Binding energy required to separate the components Nucleus (Protons + Neutrons) Separated nucleons The approximate nuclear binding energy (EB) of an atomic nucleus with atomic number Z and mass number A is calculated using the following formula EB = a,A – azA?/3 2 (А — 22)2 %3D az A1/3 A A1/ where, a = 15.67, a2= 17.23, a3 = 0.75, as = 93.2, and if A is odd if A and Z are both even, if A is even and Z is odd. a5 = 12.0 -12.0 And the binding energy per nucleon (BEN) is calculated by dividing the binding energy (Es) by the mass number (A). In this assignment you are asked to write a java…arrow_forwardDon't reject if you did not have knowledge. Assembly language. On sim8085 simulatorarrow_forwardPython Coding:arrow_forward
- Write a python code that does the following: - Asks student to enter his name - Ask them to enter their marks for 4 different modules. (Note: these marks should be out of 100 for each module) - Based on the average of the 4 different modules, the student should get the grade that they have achieved at that level. - The grades should follow the following trend - greater than or equal to 90 = A - from 80 to 89 inclusive = B - from 70 to 79 inclusive = C - from 60 to 69 inclusive = D - from 50 to 59 inclusive = E - below 50 = Farrow_forwardWrite in C Language Wooden Fence Note: Input and Output must be the samearrow_forwardContext: Measuring Air Quality Levels of various air borne pollutants such as Nitrogen Monoxide (NO), Nitrogen Dioxide (NO2) and particulate matter (also called particle pollution) are all major contributors to the measure of overall air quality. For instance, NO2 is measured using micrograms in each cubic metre of air (㎍/m3). A microgram (㎍) is one millionth of a gram. A concentration of 1 ㎍/m3 means that one cubic metre of air contains one microgram of pollutant. To protect our health, the UK Government sets two air quality objectives for NO2 in their Air Quality Strategy The hourly objective, which is the concentration of NO2 in the air, averaged over a period of one hour. The annual objective, which is the concentration of NO2 in the air, averaged over a period of a year. The following table shows the colour encoding and the levels for Objective 1 above, the mean hourly ratio, adopted in the UK. Index 1 2 3 4 5 6 7 8 9 10 Band Low Low Low Moderate Moderate Moderate High…arrow_forward
- Use pythonarrow_forwardMIPS Assembly Write a program for RISC MIPS 32bits that challenges a person to guess a number of up to 3 digits before and 3 digits after the comma, that is, a value between 000,000 and 999,999. The program user will try to guess the number with multiple attempts, where the program will indicate at each attempt if the informed number is bigger, smaller, or if the user guessed correctly. When this happens, the program ends, showing a SUCCESS message and a total count of the number of attempts taken to get it right. The program must have a SUBROUTINE as described below. SUBROUTINE:- Input Parameters: user guess, expected value- Output: message on screen (bigger, smaller, SUCCESS)- Returns: value 1 if correct, 0 if incorrectarrow_forward⦁ You are writing lines of codes for a large program. Because you only recently started programming, you are not very quick at writing code, and can only write 20 lines of code each hour. However, the more code you write, the faster you become, and so the number of lines you can write each hour changes. ⦁ If the number of lines you are writing increases by seven lines each hour, calculate the total amount of lines you would have written after 10 hours.⦁ If the amount of lines increases by a factor of 1.2 each hour, calculate the total amount of lines you would have written after 8 hours.⦁ You and your friend are both working on writing simple programs, whenever one of you finishes a program; they go outside to take a small break, then returns to work on the next program. If you need 112 minutes to write one program, and your friend needs 150 minutes to write one, after how many minutes will both of you be outside together for a break?arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr