Write a program to control a bread machine. Allow the user to input the type of bread as W for White and S for Sweet. Ask the user if the loaf size is double and if the baking is manual. The program should fail if the user inputs are invalid. The following table is a time chart for the machine used for each bread type. Print a statement for each step. If the loaf size is double, increase the baking time by 50 percent. If baking is manual, stop after the loaf-shaping cycle and instruct the user to remove the dough for manual baking. Use a function to print program instructions.
Time Chart for Making Bread
Primary kneading 15 mins 20 mins
Primary rising 60 mins 60 mins
Secondary kneading 18 mins 33 mins
Secondary rising 20 mins 30 mins
Loaf shaping 2 seconds 2 seconds
Final rising 75 mins 75 mins
Baking 45 mins 35 mins
Cooling 30 mins 3 0 mins
C++
sample output
enter loaf size d <-- double n <-- normal:d
enter baking process M <-- Manual, A <-- Automatic: A
primary kneading--> 20 mins
primary rising --> 60 mins
secondary kneading --> 33 mins
secondary rising --> 30 mins
loaf shape -->2
final rising --> 75 mins
bake for 52 mins 30 sec
cool for 30 mins
please do upvote.If you have any problem do comment and i shall be happy to help you.Thanks for using HomeworkLib.
---------------------------
#include<iostream>
#include<string>
using namespace std;
//function to get input
void get_input(string& type,string& loaf_size,string&
baking_process)
{
cout << "enter type of bread w<---white
s<----sweet: ";
cin >> type;
cout << "enter loaf size d<---double
n<----normal: ";
cin >> loaf_size;
cout << "enter baking process m<----manual
a<-----automatic: ";
cin >> baking_process;
}
int main()
{
//time chart as 2d array
double time[8][2] = { {15,20}, {60,60} ,{18,33},
{20,30} ,{2,2} ,{75,75} ,{45,35} ,{30,30} };
//variable to store data
int col = 0;
string type;
string loaf_size;
string baking_process;
string input;
//calling funcion
get_input(type, loaf_size, baking_process);
//showing time
if (type == "s")
{
col = 1;
}
else if (type == "w")
{
col = 0;
}
else
{
cout << "invalid
input\n";
return 0;
}
cout << "primary kneading----> " <<
time[0][col] << " mins\n";
cout << "primary rising----> " <<
time[1][col] << " mins\n";
cout << "secondary kneading----> " <<
time[2][col] << " mins\n";
cout << "secondary rising----> " <<
time[3][col] << " mins\n";
cout << "loaf shaping----> " <<
time[4][col] << " sec\n";
if (baking_process == "m")
{
while (true)
{
cout <<
"enter r to remove dough for baking: ";
cin >>
input;
if (input ==
"r")
{
break;
}
}
}
else if (baking_process == "a")
{
}
else
{
cout << "invalid
input\n";
return 0;
}
cout << "final rising----> " << time[5][col] << " mins\n";
if (loaf_size == "d")
{
cout << "baking ----> "
<< time[6][col]+(50.0/100.0)*time[6][col] << "
mins\n";
}
else if (loaf_size == "n")
{
cout << "baking ----> "
<< time[6][col] << " mins\n";
}
else
{
cout << "invalid
input\n";
return 0;
}
cout << "cooling ----> " <<
time[7][col] << " mins\n";
system("pause");//remove it if not required.it is used to prevent console in visual studio from closing
return 0;
}
-------------------------
Write a program to control a bread machine. Allow the user to input the type of...
Make a program using Java that asks the user to input an integer "size". That integer makes and prints out an evenly spaced, size by size 2D array (ex: 7 should make an index of 0-6 for col and rows). The array must be filled with random positive integers less than 100. Then, using recursion, find a "peak" and print out its number and location. (A peak is basically a number that is bigger than all of its "neighbors" (above,...
/*************************************************** Name: Date: Homework #7 Program name: HexUtilitySOLUTION Program description: Accepts hexadecimal numbers as input. Valid input examples: F00D, 000a, 1010, FFFF, Goodbye, BYE Enter BYE (case insensitive) to exit the program. ****************************************************/ import java.util.Scanner; public class HexUtilitySOLUTION { public static void main(String[] args) { // Maximum length of input string final byte INPUT_LENGTH = 4; String userInput = ""; // Initialize to null string Scanner input = new Scanner(System.in); // Process the inputs until BYE is entered do {...
C++ Write a program that takes in 3 inputs [players (int type), expected game time (double type), team (char type) and calculates actual game time (double) based on the following conditions: if the number of players or the expected game time is less than or equal to ZERO, it should output Wrong input if the number of players is greater than 0 and less than or equal to 6 and if they are on the 'R' or 'r' team, their...
Need some assistance of reorganizing this whole program. I have the right code for everything I just need help on putting all the codes in the right spot so it can come out to the correct output. output is supposed to look like this: 1 \\ user inputs choice to convert 12 to 24 8 \\ user inputs 8 for hours 30 \\ user inputs 30 for minutes 20 \\ user inputs 20 for seconds AM \\ user inputs AM...
Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...
C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) Last Name (char[]) Age (int) Height in Inches (double) Weight in Pounds (double) You will use pass-by-reference to modify the values of the arguments passed in from the main(). Remember that arrays require no special notation, as they are passed by reference automatically, but the other...
Write a Python program that tests the function main and the functions discussed in parts a through g. Create the following lists: inStock - 2D list (row size:10, column size:4) alpha - 1D list with 20 elements. beta - 1D list with 20 elements. gamma = [11, 13, 15, 17] delta = [3, 5, 2, 6, 10, 9, 7, 11, 1, 8] a. Write the definition of the function setZero that initializes any one-dimensional list to 0 (alpha and beta)....
Must be written in JAVA Code Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name (a single String with no spaces), the number of semester hours earned (an integer), the total quality points earned (a double). The following shows part of a typical...
Write a Python program (question2.py) that reads from a file called “input.txt” numbers in [1,39] separated in by commas. The numbers are in [1-99]. The program will then convert each number to a possible Roman Numeral equivalent, and print it on the screen. Remember, I is 1, V is 5, X is 10 For example, if the input is: 23, 11 the output is: XXIII, XI. ROMAN NUMERALS CHART 1 TO 100 69 LXIX 11 2 11 3 III 4...
I am currently facing a problem with my python program which i have pasted below where i have to design and implement python classes and record zoo database and takes user input as query. the error i am recieving says that in line 61 list index is out of range. kindly someone help me with it as soon as possible. Below is the program kindly check and correct it. Thanks! class Animal: def __init__(self, name, types, species, mass): self.name=name self.type=types...