Ingredient Adjuster
A cookie recipe calls for the following ingredients:
1.5 cups of sugar
1 cup of butter
2.75 cups of flour
The recipe produces 48 cookies with these amounts of the ingredients. Design a pro- gram that asks the user how many cookies he or she wants to make, and then displays the number of cups of each ingredient needed for the specified number of cookies.

Answers

Answer 1

Answer:

#include <iostream>

using namespace std;

int main(){

float cookies=0;

float sugar=1.5;

float butter=1;

float flour=2.75;

cout<<"how many cookies do you want: "<<endl;

cin>>cookies;

float num = cookies/48;

cout<<num<<endl;

cout<< "to make " << cookies<<"cookies you need: "<<endl;

cout<<"sugar cups: "<<num*sugar<<endl;

cout<<"butter cups: "<<num*butter<<endl;

cout<<"flour cups: "<<num*flour<<endl;

return 0;

}


Related Questions

Pick the correct statements on the 64-bit machine representation of numbers.

The relative error in any elementary arithmetic operation is bounded above by machine precision.
Most of the decimal numbers are concentrated around zero.
Division by small numbers in an iterative process is a potential source of instability.
There are as many numbers between 1 and 2 as there are between 3 and 4.
Machine precision epsilon is the smallest decimal number that could be represented on the computer.

Answers

Answer:Floating-point arithmetic is considered an esoteric subject by many people. This is rather surprising because floating-point is ubiquitous in computer systems. Almost every language has a floating-point datatype; computers from PCs to supercomputers have floating-point accelerators; most compilers will be called upon to compile floating-point algorithms from time to time; and virtually every operating system must respond to floating-point exceptions such as overflow. This paper presents a tutorial on those aspects of floating-point that have a direct impact on designers of computer systems. It begins with background on floating-point representation and rounding error, continues with a discussion of the IEEE floating-point standard, and concludes with numerous examples of how computer builders can better support floating-point.

Explanation:

Create a class RightTriangle which implements the API exactly as described in the following JavadocLinks to an external site..

Don't forget - you will need to use the Pythagorean theorem (Links to an external site.) to find the hypotenuse (and therefore the perimeter) of a right triangle. You can find the area of a right triangle by multiplying the base and height together, then dividing this product by 2.

Use the runner_RightTriangle file to test the methods in your class; do not add a main method to your RightTriangle class.

Hint 1 - Javadoc only shows public methods, variables and constructors. You will need to add some private member variables to your RightTriangle class to store the necessary information. Think carefully about what information actually needs to be stored and how this will need to be updated when methods change the state of a RightTriangle object.

Hint 2 - As in the previous lesson's exercise it's helpful to add your method/constructor headers and any dummy returns needed before implementing each one properly. This will allow you to test your code using the runner class as you go along.

This is the runner code:

import java.util.Scanner;

public class runner_RightTriangle{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
RightTriangle t = new RightTriangle();
String instruction = "";
while(!instruction.equals("q")){
System.out.println("Type the name of the method to test. Type c to construct a new triangle, q to quit.");
instruction = scan.nextLine();
if(instruction.equals("getArea")){
System.out.println(t.getArea());
}
else if(instruction.equals("getBase")){
System.out.println(t.getBase());
}
else if(instruction.equals("getHeight")){
System.out.println(t.getHeight());
}
else if(instruction.equals("getHypotenuse")){
System.out.println(t.getHypotenuse());
}

else if(instruction.equals("getPerimeter")){
System.out.println(t.getPerimeter());
}
else if(instruction.equals("toString")){
System.out.println(t);
}
else if(instruction.equals("setBase")){
System.out.println("Enter parameter value:");
double arg = scan.nextDouble();
t.setBase(arg);
scan.nextLine();
}
else if(instruction.equals("setHeight")){
System.out.println("Enter parameter value:");
double arg = scan.nextDouble();
t.setHeight(arg);
scan.nextLine();
}
else if(instruction.equals("equals")){
System.out.println("Enter base and height:");
double bs = scan.nextDouble();
double ht = scan.nextDouble();
RightTriangle tOther = new RightTriangle(bs, ht);
System.out.println(t.equals(tOther));
scan.nextLine();
}
else if(instruction.equals("c")){
System.out.println("Enter base and height:");
double bs = scan.nextDouble();
double ht = scan.nextDouble();
t = new RightTriangle(bs, ht);
scan.nextLine();
}
else if(!instruction.equals("q")){
System.out.println("Not recognized.");
}
}
}
}

My code so far:

class RightTriangle{
private double base;
private double height;
public RightTriangle(){
base = 1.0;
height = 1.0;
}
public RightTriangle(double ds, double ht){
base=ds;
height=ht;
}
public boolean equals​(RightTriangle other){
if(base==other.base && height==other.height ){
return true;
}
else
{
return false;
}
}
public double getArea()
{
return (base*height)/2;
}
public double getBase(){
return base;
}
public double getHeight()
{
return height;
}
public double getHypotenuse()
{
return Math.sqrt((base*base)+(height*height));
}
public double getPerimeter()
{
return base+height+Math.sqrt((base*base)+(height*height));
}
void setBase (double bs)
{
if(bs==0){
System.exit(0);
}
else{
base=bs;
}
}
public void setHeight(double ht){
if(ht==0){
System.exit(0);
}
height=ht;
}
public java.lang.String toString()
{
return "base: "+base+" hegiht: "+height+" hypothesis: "+ Math.sqrt((base*base)+(height*height));
}

}

MY CODE SAYS THAT THE setHeight and setBase and toString METHODS ARE INCORRECT.

Answers

Answer:

I don't see anything. Its blank

Explanation:

Amazon Web Services (AWS) has several data centers which have multiple processors that perform computations.

a. True
b. False

Answers

There is several data centers associated with Amazon Web Services (AWS) and this contain multiple processors that perform computations.

What is a data center?

A data center serves as a building that house computer systems as well as associated components for data processing. These center helps in telecommunications and storage systems.

In Amazon Web Services, these data centers contains multiple processors which is been used in computations. The processor is usually sequence with their IDs.

Learn more about data center  at;

https://brainly.com/question/25605883

4. The is the metal box that contains the main components of the computer ​

Answers

Answer:

The computer case

Explanation:

"The computer case is the metal and plastic box that contains the main components of the computer, including the motherboard, central processing unit (CPU), and power supply. The front of the case usually has an On/Off button and one or more optical drives."

What does the “mystery” function do?

Answers

Answer:

Find the product of prime number between 1and8

Answer:

function mystery() {

while (noBallsPresent()) {

move();

}

}

Explanation:

Karel moves until it is on a ball.

A web application's code prevents the output of any type of information when an error occurs during a request. The development team cited security reasons as to why they developed the application in this way. What sort of security issues did the team have concerns about in this case?

Answers

Answer:

Revealing database server configuration

Explanation:

The sort of security issues did the team have concerns about in this case is Revealing database server configuration.

What is revealing database server configuration?

A. Revealing database server configuration is known to be a kind of web application's code that hinders the output of any kind of information only if an error is taken place during a request.

Therefore, based on the scenario above, The sort of security issues did the team have concerns about in this case is Revealing database server configuration.

Learn more about  application's code from

https://brainly.com/question/23275071

#SPJ2

This project was used to drive the VR Robot to number 25 on the Number Grid
*
Map, but it does not work correctly. What is the error?
.
The VR Robot should drive in reverse first
Wait until position Yin millimeters (mm) should be GREATER than 500.no LESS
than
Wait una position Xin millimeters() should be less than 100, no CREATER
than
O
The Stop driving blocks are not needed

Answers

Answer:

B Wait until position y in millimeter should be greater than 500 at least im guessing because you didnt add what the map looked like, making my job MUCH harder

Explanation:

A(n) _____ is a network connection device that can build tables that identify addresses on each network. Group of answer choices switch adapter card dynamic router hub

Answers

A network connection device that is designed and developed to build tables that identify IP addresses on each network is called a: C. dynamic router.

What is a dynamic router?

A dynamic router can be defined as a network connection device that is designed and developed to use adaptive routing in creating or building tables that identify IP addresses on each network.

An adaptive routing is also referred to as dynamic routing and it refers to a network protocol that allows optimal data routing by selecting paths using complex routing algorithms, according to real time routing table changes in a dynamic router.

Read more on dynamic router here: https://brainly.com/question/24812743

A penetration tester is experimenting with Network Mapper (Nmap) on a test network as a privileged user. The tester would like to know the operating system of a target device and scan for commonly used ports. Select the nmap commands that will be useful in this case. (Select all that apply.)

Answers

The Network Mapper (Nmap) commands that would be useful on this test network are:

nmap xxx.xxx.x.x -pnmap xxx.xxx.x.x -A

What is a penetration test?

A penetration test can be defined as a cybersecurity technique that simulates a cyber attack against an end user's computer system, so as to scan, identify, test and check for exploitable vulnerabilities in the following:

Operating systemWeb softwareHost deviceNetwork

This ultimately implies that, a penetration test avails an tester the ability to exploit a weakness and potential security threats on a test network as a privileged user, during vulnerability assessments of the system.

The Network Mapper (Nmap) commands.

In this scenario, the Network Mapper (Nmap) commands that would be useful on this test network are:

nmap xxx.xxx.x.x -pnmap xxx.xxx.x.x -A

Read more on penetration test here: https://brainly.com/question/25813524

What are two things to consider when linking pages in your website? How are your decisions about absolute and relative URLs affect the reliability of your links?

Answers

The two (2) things to consider when linking webpages in your website include:

The names of the hyperlink.The proper use of anchor text.

What is a hyperlink?

A hyperlink can be defined as an element in a hypertext markup language (HTML) document such as a website, which provides a direct access or link to another HTML document, webpage, location, and image.

Basically, a hyperlink links to the same webpage in a hypertext markup language (HTML) document such as a website.

The things to consider when linking webpages.

In Web design, the two (2) things to consider when linking webpages in your website include:

The names of the hyperlink: it should be the same as the webpage name that is being linked to.The proper use of anchor text: it is more advisable to use anchor text rather than linked images.

An absolute URL contains all the information (protocol and domain name) that are needed to locate a resource while a relative URL can only locate a resource by using an absolute URL as a starting point because it doesn't contain any protocol.

In conclusion, an absolute URL helps to improve and enhance the reliability of your links because it contains the entire information that are needed to locate a resource.

Read more on absolute URL here: https://brainly.com/question/23338043

Write a program that does the following:

You will make a program that registers the maximum TEMPERATURE that is registered during the WEEK (that is, every day, that is, 7 days).

You must at the end show/print the number of temperatures that were HOT (May or equal to 25 degrees) and those that were COLD (less than or equal to 10 degrees)

The program MUST have DO WHILE and IF.






IN JAVA SCRIPT AND PLEASE SEND THE CODE IN THE COMMENTS

Answers

Answer:

Mean maximum temperature is measured by taking maximum temperatures and add them up and divide again by as many as the mean highest temperatures you added up. One measures the mean of only highest temperatures and the other the average of all high temperatures.

Explanation:

Why do we use for loops with arrays?
Group of answer choices

For loops let us access one specific element of an array.

Lets us quickly process contents of the array.

To store one piece of data at a time.

For loops let Python handle the values as strings not numbers.

Answers

B. Let’s us quickly process contents of the array

how to maintain large processors

Answers

avoiding turning it off with the power switch or power button use the os to turn it off

how can one improve the quality of the search results when using internet services such as research methods

Answers

Answer:

Vary Your Search Engine. Use Specific Keywords.Simplify Your Search Terms. Use Quotation Marks. Remove Unhelpful Words. Refine Your Search Using Operators.Avoid Search Pitfalls.

Explanation:

what is the numeric value of 19%(2+3) as evulated by Java

Answers

Answer:

4

Explanation:

java does parenthesis first then mod so it will do 2+3 which is 5 then 19 mod 5 which is 4(5 goes in evenly 3 times for a total of 15. Mod is the remainder number meaning that 19-15 = 4).

Write a program to store the elements (30,3,8,7,5) and display their location

Answers

Answer:

why did you delete my answeR?

30, 3, 8, 7, 5

convert 34.657 to binary and also 25.75 to binary

Answers

Answer:

34.657=100010.1010100000110001001 base two

25.75  =11001.11

what is computer/why it is called data processor

Answers

Answer:

Computer is known as data processor because it processes the data. First the data is inserted in the computer through input devices. After that, computer translate the data in its own language and then the computer takes action according to the instructions given to the computer

_____ is the use of large amounts of data, organized and presented to identify patterns and trends. Continuous Improvement Continuous Improvement Usability testing Usability testing Analytics Analytics System implementation

Answers

Analytics is the use of large amounts of data, organized and presented to identify patterns and trends.

What is Data?

This is defined as the raw form of information which has to undergo processing and analysis.

Analytics involves the use of data which aren't easily detected in ensuring that patterns and trends are identified through their interpretation.This therefore makes it the most appropriate choice.

Read more about Analytics here https://brainly.com/question/25819900

Answer:

Analytics

Explanation:

got it right on edge

explain 3 advantages and 3 disadvantages of computers ​

Answers

Answer:

advantage

1: finish tedious tasks faster (writing an essay)

2: the internet (you can learn anything)

3: reduces the use of paper

disadvantage

1: social media (being addictive toxic)

2: decreasing jobs

3: less time for people to interact in person

Explanation:

hiya!!!

advantages:

1. computers make information more accessible
2. they help pass time
3. they store documents and data

disadvantages:

1. information can get leaked
2. costly
3. uses up electricity

hello everyone can help me give all the answer​

Answers

Answer:

1. were

2. were

3 was

4 was

5 were

1 wasnt

2 werent

3werent

4 wasnt

5 werent

were you at work?

was it in the garden?

were they worried?

was lucy present?

were his friends late?

1 they were

2 it was

3 he wasn't

4 I was

5 they weren't

Explanation:

how to write a code that determines if a number is odd or even?
the code should start with a variable declaration

Answers

Answer:

//code in c++

#include <iostream>

using  namespace std;

int main() {

   int a;

   cin>>a;

   if(a%2==0){

       cout<<"Even number";

   }

   else{

       cout<<"Odd number";

   }

return 0;

Explanation:

Given the user inputs, complete a program that does the following tasks: Define a set, fruits, containing the user inputs: my_fruit1, my_fruit2, and my_fruit3. Add the user inputs, your_fruit1 and your_fruit2, to fruits. Add the user input, their_fruit, to fruits. Add your_fruit1 to fruits. Remove my_fruit1 from fruits. Observe the output of each print statement carefully to understand what was done by each task of the program. Note: For testing purposes, sets are printed using sorted() for comparison, as in the book's examples. Ex: If the input is:

Answers

The program is an illustration of sets in a python program

What are sets?

Sets are variables that hold multiple values in a program

The main program

The program written in Python, where comments are used to explain each line is as follows:

my_fruit1 = input()

my_fruit2 = input()

my_fruit3 = input()

your_fruit1 = input()

your_fruit2 = input()

their_fruit = input()

# 1. TODO: Define a set, fruits, containing my_fruit1, my_fruit2, and my_fruit3

fruits = {my_fruit1, my_fruit2, my_fruit3}

print(sorted(fruits))

# 2. TODO: Add your_fruit1 and your_fruit2 to fruits

fruits.add(your_fruit1)

fruits.add(your_fruit2)

print(sorted(fruits))

# 3. TODO: Add their_fruit to fruits

fruits.add(their_fruit)

print(sorted(fruits))

# 4. TODO: Add your_fruit1 to fruits

fruits.add(your_fruit1)

print(sorted(fruits))

# 5. TODO: Remove my_fruit1 from fruits

fruits.remove(my_fruit1)

print(sorted(fruits))

Read more about python programs at:

https://brainly.com/question/26497128

Anyone know why my pc won’t start up I upgraded my ram and everything seems fine

Answers

Answer:

RAM Slots

Explanation:

If you upgraded RAM then check if RAM is in correct slots according to the Motherboard Manual, i had the same issue when i replaced my RAM.

hello everyone I need some help with what a footer is on a web page

Answers

Answer:

A website's footer is an area located at the bottom of every page on a website, below the main body content

Explanation:

By including a footer, you make it easy for site visitors to keep exploring without forcing them to scroll back up.

Determine the binary encoding for a system that uses two’s complement of the base-10
quantities negative six and six for a digital system where all binary numbers are represented by four bits, one where all numbers are represented by eight bits (one byte).

Answers

Answer:

4 bits:

6 = 0110

-6 = 1010

8 bits:

6 = 00000110

-6 = 11111010

Explanation:

2's complement is easier to implement, because it only has one representation of 0 and starts counting backwards from the highest number you can represent with the available bits.

e.g.,

7 = 0111

6 = 0110

5 = 0101

4 = 0100

3 = 0011

2 = 0010

1 = 0001

0 = 0000

-1 = 1111

-2 = 1110

-3 = 1101

-4 = 1100

-5 = 1011

-6 = 1010

For 4 bits:

-6 = 01106 = 1010

For 8 bits (1 byte):

-6 = 0000 + 0110 = 000001106 = 1111 + 1010 = 11111010

What is binary encoding?

Binary encoding can be defined as a standard technique that is designed and developed to convert data in plain text (source alphabets) to a form that is easily used by different operating systems (OS), especially through the use of a binary digit (bit) or two-symbol system.

The two’s complement of base-10.

In Computer programming, two's complement of base-10 is generally easier to implement because it has a single representation of 0 only.

Decimal      Two’s Complement      Decimal      Two’s Complement

    0                       0000                        0                        0000

    1                       1111 1111                       -1                      0000 0001

    2                      1111 1110                      -2                    0000 0010

    3                      1111 1101                      -3                    0000 0011

    4                      1111 1100                     -4                    0000 0100

    5                      1111 1011                      -5                    0000 0101

    6                      1111 1010                     -6                    0000 0110

    7                      1111 1001                     -7                    0000 0111

    8                      1111 1000                    -8                    0000 1000

For 4 bits:

-6 = 0110

6 = 1010

For 8 bits (1 byte):

-6 = 0000 + 0110 = 00000110

6 = 1111 + 1010 = 11111010

Read more on binary encoding here: https://brainly.com/question/5381889

What is an object? Give five examples of real world objects.

Answers

Answer:

things u can touch

Explanation:

paper

pen

eraser

table, metal

Create a python program that will input their name and their age. It will show an output "Hi, {name} ! How are you? I know you are {age} old."

I WILL MARK YOU AS BRAINLIEST​

Answers

Answer:

age = 10

name = Cynthia

make an f string so the variables appear in the string. There are other ways to do this but I prefer f strings instead of using string concatenation. It causes problems adding 2 strings together most of the time.

print(f'Hi, {name} ! How are you? I know you are {age} old.')

Which formula is used to measure accuracy?

Answers

The accuracy formula provides accuracy as a difference of error rate from 100%. To find accuracy we first need to calculate the error rate. And the error rate is the percentage value of the difference of the observed and the actual value, divided by the actual value

a. Modify the FitnessTracker class that includes data fields for a fitness activity, the number of minutes spent participating, and the date. The class includes methods to get each field. In addition, create a default constructor that automatically sets the activity to running, the minutes to 0, and the date to January 1 of the current year. Create an application that demonstrates each method works correctly.


b. Create an additional overloaded constructor for the FitnessTracker class you created in Exercise 3a. This constructor receives parameters for each of the data fields and assigns them appropriately. Add any needed statements to the TestFitnessTracker.java application to ensure that the overloaded constructor works correctly, save it, and then test it.


An example of what it should look like:

running 0 minutes on 2021-01-01

bicycling 35 minutes on 2020-08-20


What's done:

import java.time.*;

public class FitnessTracker {

String activity;

int minutes;

LocalDate date;

// constructor for 3a

public FitnessTracker() {

}

// constructor for 3b

public FitnessTracker(String a, int m, LocalDate d) {

}

public String getActivity() {

}

public int getMinutes() {

}

public LocalDate getDate() {

}

}

Answers

Answer:

It keeps saying servers fully loaded

Explanation:

Other Questions
What central ideas did the magna carta, the petition of right, and the english bill of rights have in common? how did these ideas influence the governments that the english settlers established in the colonies?. dominate language of latin america in the 1800s An expense resulting from failing to take advantage of cash discounts when using the net method of recording purchases is called: Discounts earned. Purchases discounts. Discounts lost. Sales refund payable. Sales discounts. It is best to leave an ______object in place and stabilize it while transporting the patientAn object should only be removed in the field if______is needed Find 25% of 116 I don't know the answer can any one solve this please?and with step-by-step explanation. Tell me the reason why looking at someone phone screen is wrong and why we should stop doing this. Give me a reason and why we should stop it. Which excerpt from the awakening best illustrates the idea that self-determintion can lead to isolation why living things need to move Phases of MitosisPhaseEventProphase1.Chromosomes attach to spindle fibers.2. MetaphaseAnaphase3.4.New nuclear envelope forms. what are the four parts of mathematical system? (URGENT NEED OF HELP!!) match the descriptions to the correct causes of world war I1. European nations were increasing military spending and building up their militaries with modern technology. Military rivalries between countries created an atmosphere of distrust. 2. There were secret agreements between partnered countries to defend each other when threatened by enemies. Each partnered country would bring several Nations to its aid. Any small-scale conflict will become enlarged with so many secret friends.3. many countries believe they were Superior to other countries every country in the Balkans region thought they were better than the next. so many countries believed in their superiority over others, that they would fight for their country when war began. 4. European nations were competing around the world to take over land and build their empires. Competition for land and colonies would lead to squabbles and conflict. options to match those with are, imperialismalliancesnationalismmilitarism 220 v is applied to two different conductors made of the same material. One conductor is twice as long and twice the diameter of the second. what are the root cause of damestic violence? Why do you belive this to be true? 35% of what number is 105? The base of an inosceles triangle is 30" and the altitude to that base is 8" Find the length of one ofthe two equal sides of the triangle. Please help!! I literally have no idea what to do here. What was the Industrial Revolution in America Harvey's family is suing Dr.Weber for medical malpractice due to negligence. The negligence suit states that after a knee replacement surgery, Dr.Weber sent Harvey home for recoveryand therapy. After the surgery, Harvey developed evidence of infection within a week of the surgery, and the infection progressed to sepsis and death within 5 weeks after surgery. The suitstates that the infection was a result of the surgery and post-surgical care, and that Dr. Weber was negligent because he did not diagnose and treat the infection. What evidence could themedical assistant provide that would indicate that Dr. Weber's lack of care was not the direct cause of Harvey's death?A. Documentation showing that Harvey signed the inform consent from prior to surgery B. Records show the doctor with her nurse provided patient teaching to Harvey about the signs and symptoms of infection after surgery.C. Pre- operative laboratory results showing that Harveys white blood cell count was normal. D. Rcords showing that Harvey did not keep of the three week follow up appointment after surgery. PLEASE HELP!!!According to the density gradient model, the MOST densely packed part of the city is... a. closest to the city core b. in the first ring c. in the second ring d. in the third ring e. in the suburbs