restate the problem in your own words, specifies what input is needed from whome
ID: 3749933 • Letter: R
Question
restate the problem in your own words, specifies what input is needed from whomever is using the process, what output is expected, and the step by step process (algorithm) to get the output from the input each of the 3 problems given below. You should not write any actual C++ code.
Use the idea of repetition for the following problems. Do not write any code, but you can usephrases such as “Repeat steps 2 through 5 until all values have been entered”. Do not use concepts of arrays or functions.
can someone please help me figure out how to write the algorithm for these problems?
Problem 1: Create a process that will prompt a user to enter a series of letter grades for studentsin a class as A, B, C, D, or F and count the number of A’s, B’s, C’s, D’s, and F’s.
Problem 2: Suppose your company produces resistors in batches of 100. To pass, an individual resistor must has a resistance from 3 to 3.5 ohms including 3 and 3.5ohms. Create a process to determine how many resistors did not pass in a given batch.
Problem 3: Create a process that will ask the user to enter an initial temperature in Fahrenheit and a final temperature in Fahrenheit. Then create a table with 50 temperatures from the initial to final Fahrenheit temperatures (including the initial temperature) and the corresponding temperatures in Celsius, and Kelvin.
Explanation / Answer
Problem 1
INPUT: Grades of each students in class
OUTPUT:CountTotal number) of each grades
Algorithm:
Step 0:Get totalStudents
Step 1:Initialize counta,countb,countc,countd,counte,countf to 0 and studentCount to 0
Step 2:Enter grade of a student and increment studentCount by 1
Step 3:IF grade equal to A , increment counta by 1 and goto step 10
Step 4:IF grade equal to B , increment countb by 1 and goto step 10
Step 5:IF grade equal to C , increment countc by 1 and goto step 10
Step 6:IF grade equal to D , increment countd by 1 and goto step 10
Step 7:IF grade equal to E , increment counte by 1 and goto step 10
Step 8:IF grade equal to F , increment countf by 1 and goto step 10
Step 9:IF grade equal to B , increment countb by 1 and goto step 10
Step 10:IF studentCount is less than totalStudents , repeat steps 2-9
Step 11:Print counta,countb,countc,countd,counte,countf
Problem 2
INPUT:resistance of resistors
OUTPUT:no. of resitors which has not passed the test
Algorithm
Step 1: Initialize count,badCount to 0
Step 2:Get resistance of 1 resistor
Step 3:Check IF 3 less than or equal to resistance and resisitance less than or equal to 3.5
Step 4:If Step3 is true goto step 6 ,else step 5
Step 5:Increment badCount by 1
Step6:IF count less than 100 , repeat steps 2-5 , else goto step 7
Step7:Print badCount
Problem 3
INPUT:Initial and final temperature
OUTPUT:A table containing 50 temperatures from initial to final and their corresponding temperatures in Celsius and Kelvin
Algorithm
Step 1:Get initalTemp and finalTemp
Step 2:Calculate incrementValue=(finalTemp-initialTemp)/50
Step 3:Initialize temp=initialTemp , tempC=0 and tempK=0
Step 4:Calculate tempC=(temp-32)*(5/9)
Step 5:Calculate tempK=(temp+459.67)*(5/9)
Step 6:Print temp ,tempC,tempK
Step 7:If temp less than finalTemp,increment temp by incrementValue ,repeat steps 4-6
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.