Write the definition of a function that takes as input three numbers. The function returns true if the floor of the product of the first two numbers equals the floor of the third number; otherwise it returns false. (Assume that the three numbers are of type double.) (4)

Answers

Answer 1

Answer:

Written in C++

bool checkfloor(double num1, double num2, double num3) {

   if(floor(num1 * num2) == floor(num3)){

       return true;

   }

   else {

       return false;

   }

}

Explanation:

The function written in C++

This line defines the function

bool checkfloor(double num1, double num2, double num3) {

The following if condition checks if the floor of num1 * num2 equals num3

   if(floor(num1 * num2) == floor(num3)){

       return true; It returns true, if yes

   }

   else {

       return false; It returns false, if otherwise

   }

}

See attachment for full program including the main


Related Questions

Lab9A: Warmup. Write a program that contains three methods: Method max (int x, int y, int z) returns the maximum value of three integer values. Method min (int X, int y, int z) returns the minimum value of three integer values. Method average (int x, int y, int z) returns the average of three integer values. Note: for Java and C#, these methods must be public and static. Prompt the user for three numbers, then call these methods from main to print out the minimum, maximum and average of numbers that the user entered. Your program should behave like the sample output below. Sample output #1 Enter number 1: 5 Enter number 2: 9 Enter number 3: 2 Min is 2 Max is 9 Average is 5.33333 Sample output 2 Enter number : 45 Enter number 2 : 11 Enter number 3: -3 Min is-3 Max is 45 Average is 17.6667

Answers

import java.util.Scanner;

import java.util.Arrays;

public class JavaApplication30 {

   public static int max(int x, int y, int z){

       int[] arr = {x, y, z};

       Arrays.sort(arr);

       return arr[2];

   }

   public static int min(int x, int y, int z){

       int[] arr = {x, y, z};

       Arrays.sort(arr);

       return arr[0];

   }

   public static double average(int x, int y, int z){

       return  (double) (x + y + z) / 3;

   }

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter your first number");

       int x = scan.nextInt();

       System.out.println("Enter your second number");

       int y = scan.nextInt();

       System.out.println("Enter your third number");

       int z = scan.nextInt();

       

       System.out.println("Min is "+min(x,y,z));

       System.out.println("Max is "+max(x,y,z));

       System.out.println("Average is "+average(x,y,z));

   }

   

}

I hope this helps! If you have any more questions, I'll try my best to answer them.

A user can view
and
in the Reading pane.

Answers

Answer:

sorry,but I can't understand your question.

Answer:

email messaging and attachments

Explanation:

2023 edg 100%

Help me will give brainliest. So can you do number 2 about gaming please

Answers

Answer: Some insights big data can provide about my hobby, gaming, is what year a certain game was created or the number of purchases made in a year. These insights can make things better for me by knowing what versions to receive first and what's the best game to get. Although, some ways big data can make it worse is by not understanding what the information is saying due to a lack of data or context. They can also make it worse by data and system errors, causing problems for me due to the decisions I make off of it.  

I hope this helped!

Good luck <3

What is payload?
a block of data inside the packet
a block of data transmitted across a network
the maximum amount of data a network can transmit
a 32-bit numeric address

Answers

Answer:

a block of data inside the packet

Allison is writing a program in Java and keeps getting an error. Which line of code is causing the error?

A. Int a = 0, b = 3, c;
B. for(i = 0, i <= 13, i++) {
C. c = (a * 2) + i;
D. System.out.println(c);

}

Answers

B will cause an error.

Allison needs to declare a type for variable i and use semi-colons.

The for statement should be for(int i = 0; i <=13; i++){

Who wants to play nitro type with me. My user is thievesGuildcuu

Answers

Answer:

I can

Explanation:

Answer:

Sure.

My user Name is: Queen Void.

Write a multi-way if statement that compares the double variable pH with 7.0 and makes the following assignments to the bool variables neutral, base, and acid:

Answers

Answer:

try:

   pH = float(input("Enter number between 0 to 14: "))

except ValueError:

   print("input must be a number")

if pH < 7:

   print("pH is Acidity")

elif pH == 7:

   print("pH is neutral")

else:

   print("pH is Base/alkaline")(

Explanation:

The try and except statement is used to check if the input is a number, if its not, the print statement is displayed. The nested if statement compares the pH input to know if it is an acid, base or neutral.

Which XXX and YYY correctly output the smallest values? Vector user Vals contains integers (which may be positive or negative). Choices are in the form XXX/YYY. // Determine smallest (min) value int minval; XXX for (i = 0; i < uservals.size(); ++i) { if (YYY) { minval - userVals.at(i); cout << "Min: " << minval << endl; minval - uservals.at(); /uservals.at(i) < minval minval = 0; /userval > minval minval - uservals.at(); /uservals.at(i) > minval minval - 0; /userval < minval

Answers

Answer:

The answer is "minVal - userVals.at(0); /userVals.at(i) < minVal  "

Explanation:

In the question, it uses minVal instead of XXX to hold the very first arra(userVal) element, and rather than YYY you choose a conditional statement to check which integer is lower than minVal to index of loop increment. It changes the value of the minVal if the condition is valid. It's completely different if we talk about another situation.

Which of the following situations is least likely fair use

Answers

Answer:

Is there more to the question or is that it?


Where are the situations??

There is no danger of data collision with this topology.

bus
mesh
ring
star

Answers

Answer:

ring

Explanation:

The Answer


C.Ring

This is evident beacause I am your advisor and I made that test so

Vector testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full credit is 100, so anything over 100 is extra credit.

Answers

Question:

Vector testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full credit is 100, so anything over 100 is extra credit. Ex: If testGrades = {101, 83, 107, 90}, then sumExtra = 8, because 1 + 0 + 7 + 0 is 8.

#include <iostream>

#include <vector>

using namespace std;  

int main() {

  const int NUM_VALS = 4;

  vector<int> testGrades(NUM_VALS);

  int i = 0;

  int sumExtra = -9999; // Assign sumExtra with 0 before your for loop  

  testGrades.at(0) = 101;

  testGrades.at(1) = 83;

  testGrades.at(2) = 107;

  testGrades.at(3) = 90;

   /* Your solution goes here  */

  cout << "sumExtra: " << sumExtra << endl;

  return 0;

}

Answer:

Replace /* Your solution goes here  */  with the following lines of code

sumExtra = 0;

do{

if(testGrades.at(i) > 100){

sumExtra = sumExtra + (testGrades.at(i) - 100);

}

i++;

}

while(i<NUM_VALS);

Explanation:

In the complete question posted,  the variables sumExtra and i have already been declared an initialized.

So, the first thing we do in the solution is:

set  sumExtra to 0 using sumExtra = 0;

Then iterate through vector testGrades using i as the iterating variable

Here, I made used of a do while loop and the explanation is as follows:

do{

This line checks if current element of the vector is greater than 100

if(testGrades.at(i) > 100){

If yes, the extra digits above 100 is added to the sumExtra

sumExtra = sumExtra + (testGrades.at(i) - 100);

}

The counter is increased, here

i++;

}

The loop is continued while the iterating variable i is less than NUM_VALS which is 4

while(i<NUM_VALS);

Which best explains the workplaces of employees in the Energy career cluster?

Employees work outdoors.
Employees can work in a wide variety of places.
Employees can work in a limited number of places.
Employees work indoors.

Answers

Answer: It’s Letter (B) the other ones just don’t fit.

Explanation:

Mark me as brainlest please?!!

Answer:

b

Explanation:

Other Questions
13x - 5y (if x = 10 and y = 6) I NEED HELP! I WILL MARK YOU AS BRAINLIEST IF YOU ANSWER CORRECTLY! :D Wendy made her career planning timeline in 2010. In what year shouldWendy's timeline start?A. 2010B. 2013C. 2012D. 2011 A man has 14 of a kilogram of couscous.He shares at equally amongst 2 people. How many kilograms does each person get? Input your answer as a fraction of a kilogram. NEED HELP ASAP PLZ HELPQuestion 2 (10 points)In 3-5 complete sentences, explain why the period from 700 C.E. to 1300 GE was called "The Golden Age of Islam."Use the "RAP" method to answer this question: Restate the question Answer the question Prove your answer citing textual evidence from the course,Don't forget to proofread your answer. The total operating cost to run the organic strawberry farm varies directly with its number of acres. What is the constant of variation in this scenario? Why would Christians think funerals are not important What is nicotine withdrawal, and what are nicotine substitutes I need help ASAP!!!!!!! Tell me about one of these founding fathers: Benjamin Franklin, Thomas Jefferson, George Washington. (you pick the person) How can people stop being Homophobia? England Colonization1 Queen Elizabeth wanted to establish colonies in the Americas in order to grow the British Empire and to counter the Spanish, who had settled first in present-day St. Augustine, Florida (1565). The English hoped to find wealth, create new jobs, and establish trade ports along the coast of the Americas. The first successful English settlement was Jamestown, Virginia (1607). 2 Each colony, however, has its own unique history on how it was founded. Many of the colonies were founded by religious leaders or groups looking for religious freedom. These colonies included Pennsylvania, Massachusetts, Maryland, Rhode Island, and Connecticut. Other colonies were founded purely in hopes of creating new trade opportunities and profits for investors. Why did Colonists Come3 Many settlers came for better economic opportunities. Europe was really crowded and it was difficult to find a job. Families would also leave their fortunes to older sons which made younger siblings look somewhere else for money. Indentured Servants came and agreed to work for a family in exchange for a boat ticket.4 Many settlers came for religious freedom. The Protestant Reformation created hundreds of new religious groups and some religions became oppressed. The most famous group is the Pilgrims in Plymouth Rock (present-day Massachusetts, 1620). 5 However, many settlers were forced to come against their will. African slaves were kidnapped or traded in order to come to American and work. Many came and were forced to work on large plantations with no hope of freedom. Carolina Colony6 Initially given to Sir Robert Heath in 1629 by King Charles I, North and South Carolina were once one colony (Carolina). However, nothing was created from it. Eventually, Virginia settlers started moving South to present-day North Carolina in the late 1650s-early 1660s. The first permanent English settlers, Nathaniel Batts and George Durant, purchased land from the natives who lived in the Albemarle Region (present-day Northeastern N.C.) By the time the British king (Charles II) chartered it in 1663, hundreds of settlers were already living there. 7 King Charles II split up the Carolina colony among eight Lords Proprietors, men who helped him regain the throne after the English Civil War. The Lords Proprietors were required to collect taxes, or quit-rents, from the settlers in order to keep their share of the land. The problem? The settlers, who were used to living independently without paying taxes, refused to do this. 8 The tension over taxes and political power led to multiple conflicts between the settlers and Lords Proprietors colonial officials, including Culpepers Rebellion (1677). Continued conflicts over politics and religion, plus fighting with the natives (notably the Tuscarora War) split the colony into North and South Carolina in 1712. North Carolina became a royal colony in 1729, controlled by the king himself.Questions:Why did Queen Elizabeth I want to colonize the New World (Americas)?What were some of the reasons why English settlers wanted to come to the New World?Why were colonies like Massachusetts, Pennsylvania, Maryland, and Connecticut founded?Compare indentured servants and slaves coming to the New World. Why did they come?Who were the first English settlers in the Carolina colony?What were three major reasons why the Carolina colony split into North and South Carolina? If a bike is going at 26 centimeters per second how many meters per minute is she traveling? What type of compound is disulfur dichloride?a. organic compoundb. acid (ionic compound)c. covalent compoundd. ionic compound the weight of 6 eggs is shown. identify the constant of proportionality of total weight to number of eggs. the weight of 6 eggs is 288 g. As a sample's temperature increases, which two factors also increase?A. Particle speedO.B. Particle boiling pointC. Particle kinetic energyD. Particle sizeHelp please solve nt+6-xt=s for t Name the bases of the prism What are the efforts that one has to make develop peace and friendship? Illustrate. Brenda won 59 lollipops playing hoops atthe county fair. At school she gave two toevery student in her math class. She onlyhas 1 remaining. How many students arein her class?