(Ramanujan's Taxi) Srinivasa Ramanujan indian mathematician who became famous for his intuition for numbers. When the English mathemematician G.H. Hardy came ot visit him in the hospital one day, Hardy remarked that the number if his taxi was 1729, a rather dull number. To which Ramanujan replied, "No, Hardy! It is a very interesting number. It is the smallest number expressible as the sum of two cubes in two different ways." Verify this claim by writing a program Ramanujan.java that takes a command-line argument N and prints out all integers less than or equal to N that can be expressed as the sum of two cubes in two different ways. In other words, find distinct positive integers a, b, c, and d such that а3 + b3 = c3 - d3. Hint: Use four nested for loops, with these bounds on the loop variables: 0 < a < 3√N, a < b < 3√N - a3, a < c < 3√N and c < d < 3√N - C3; do not explicitly compute cube roots, and instead use x . x *x < y in place of х < Math.cbrt (y).
$ javac Ramanujan.java
$ java Ramanujan 40000
1729 = 1"3 + 12^3 = 9^3 + 10"3
4104 = 2^3 + 16^3 = 9^3 + 15^3
13832 = 2^3 + 24^3 = 18^3 + 20^3
39312 = 2^3 + 34^3 = 15^3 + 33^3
32832 = 4^3 + 32^3 = 18^3 + 30^3
20683 = 10^3 + 27^3 = 19^3 + 24^3

Answers

Answer 1

Answer:

Here the code is given as follows,

Explanation:

Code:

public class Ramanujan {  

   public static void main(String[] args) {  

       // check cmd argument

       int n = Integer.parseInt(args[0]);  

       // checking a^3 + b^3 = c^3 + d^3  

       // outer loop

       for (int a = 1; (a*a*a) <= n; a++) {  

           int a3 = a*a*a;  

           // no solution is possible, since upcoming a values are more

           if (a3 > n)  

               break;  

           // avoid duplicate

           for (int b = a; (b * b * b) <= (n - a3); b++) {  

               int b3 = b*b*b;  

               if (a3 + b3 > n)

                   break;  

               // avoid duplicates

               for (int c = a + 1; (c*c*c) <= n; c++) {  

                   int c3 = c*c*c;  

                   if (c3 > a3 + b3)

                       break;  

                   // avoid duplicates

                   for (int d = c; (d * d * d) <= (n - c3); d++) {  

                       int d3 = d*d*d;  

                       if (c3 + d3 > a3 + b3)  

                           break;  

                       if (c3 + d3 == a3 + b3) {

                           System.out.print((a3+b3) + " = ");

                           System.out.print(a + "^3 + " + b + "^3 = ");  

                           System.out.print(c + "^3 + " + d + "^3");  

                           System.out.println();

                       }

                   }

               }

           }

       }

   }

}

(Ramanujan's Taxi) Srinivasa Ramanujan Indian Mathematician Who Became Famous For His Intuition For Numbers.

Related Questions

Can you help me in this question

Answers

Answer:

I think the third one (or the one with monkeys).

Explanation:

2+2 does not equal 5, so the if then statement is void because both parts are wrong.

1+1 does not equal 3 even if 2+3 =5, so it is not the second answer.

3+1 does not equal 3, but monkeys do fly and it is an or option, so when one of them is correct in an or, it is correct.

Explain in details:
(i) Deadlock
(ii) File manager
(iii) Process
(iv) Multiprogramming
(v) Software Classification
(vi) Virtual memory

Answers

Answer and Explanation:

Deadlock occurs when two operating systems on the same computer are hindering each other's execution, getting blocked, waiting for each one to run first. This can happen when a preemption has not occurred, when a mutual exclusion has occurred, or when one of the systems causes the other to not execute.

File manager is software that allows a computer user to create directories and organize files inside and outside of them.

Process is the term used to determine the functioning of computer software. When a software is started, it uses its own programming code to perform a specific activity.

Multiprogramming is the term used for the moment when an operating system allows the user to run more than one software at the same time. For this to happen, the computer needs to have a high processing capacity, to handle the effort of running several software simultaneously.

Software Classification is the process that determines the composition and different aspects that make up a software. In this way, it is possible to understand the usefulness and programming of this software.

Virtual memory is the use of secondary memory for caching. This allows the user to share files more securely and quickly, in addition to alleviating the problems that limited memory presents.

After the explosion of the Union Carbide plant the fire brigade began to spray a curtain of water in the air to knock down the cloud of gas.a. The system of water spray pipes was too high to helpb. The system of water spray pipes was too low to helpc. The system of water spray pipes broked. The system of water spray pipes did not have sufficient water supply

Answers

Answer:

d. The system of water spray pipes did not have sufficient water supply

Explanation:

The Union Carbide India Ltd. was chemical factory situated at Bhopal that produces various pesticides, batteries, plastics, welding equipment, etc. The plant in Bhopal produces pesticides. In the year 1984, on the night of 2nd December, a devastating disaster occurred on the Bhopal plant which killed millions of people due to the leakage of the poisonous, methyl isocyanate. This disaster is known as Bhopal Gas tragedy.

Soon after the gas pipe exploded, the fire brigade started spraying water into the air to [tex]\text{knock down}[/tex] the cloud of the gases in the air but there was not sufficient amount of water in the water sprays and so it was not effective.

Thus the correct answer is option (d).

In which type of class methods is it typically necessary to filter bad arguments (either directly or indirectly with the help of validators) in order to protect private data of your class

Answers

Answer: hello your question is incomplete attached below is the complete question

answer :

A set() method (non-constructor mutator). ( B )

Explanation:

The type of class methods that is necessary to filter bad arguments to protect private data of your class using validators is :

A set() method (non-constructor mutator)

What has happened (or is still happening) to make this speech occur? armageddon

Answers

Answer:

Are you talking about the bruce willis is superman basically? Because if so i don't think so because that is a future event that hasn't happened yet also that film sucks.

Explanation:

Prime numbers can be generated by an algorithm known as the Sieve of Eratosthenes. The algorithm for this procedure is presented here. Write a program called primes.js that implements this algorithm. Have the program find and display all the prime numbers up to n = 150.
Sieve of Eratosthenes Algorithm
To Display All Prime Numbers Between 1 and n
Step 1: We need to start with all the numbers representing the range of numbers that are possible candidate primes. So, create an array of consecutive integers from 2 to n: (2,3,4,..n). I wouldn't hand-code this. I would use a loop to populate the array.
Step 2: At each step we select the smallest number and remove all it's multiples. So we'll start with an outer loop that goes from 2 to n. initially, let p equal 2, the first prime number.
Step 3: In an inner loop we need to iterate over all the numbers that are multiples of p, i.e for 2, that's 2,4,6,8 etc. Each time, setting it's value to false in the original array.
Step 4: Find the first number greater than p in the list that is not marked False. If there was no such number, stop. Otherwise, let p now equal this number( which is the next prime), and repeat from step 3.
When the algorithm terminates, all the numbers in the list that are not marked False are prime
Example: Let us take an example when n = 50. So we need to print all print numbers smaller than or equal to 50. We create list of all numbers from 2 to 50.
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50

Answers

Answer:

const MAXNR=150;

let candidates = {};

for(let i=2; i<=MAXNR; i++) {

   candidates[i] = true;

}

for(let p=2; p <= MAXNR; p++) {

   if (candidates[p]) {

       process.stdout.write(`${p} `);

       // Now flag all multiples of p as false

       i=2;

       while(p*i <= MAXNR) {

           candidates[p*i] = false;

           i++;

       }

   }

}

Suppose that the first goal in a GP problem is to make 3 X1 + 4 X2 approximately equal to 36. Using the deviational variables d1− and d1+, the following constraint can be used to express this goal.​

3 X1 + 4 X2 + d1− − d1+ = 36

If we obtain a solution where X1 = 6 and X2 = 2, what values do the deviational variables assume?

a. d1− = 0, d1+ = 10
b. d1− = 6, d1+ = 0
c. d1− = 5, d1+ = 5
d. d1− = 10, d1+ = 0

Answers

Answer:

d. d1− = 10, d1+ = 0

Explanation:

Given

3X1 + 4X2 +d1− − d1+ = 36

X1 = 6

X2 = 2

Required

Possible values of d1- and d1+

We have:

3X1 + 4X2 +d1− − d1+ = 36

Substitute values for X1 and X2

3 *6 + 4 * 2 + d1- - d1+ = 36

18 + 8 + d1- - d1+ = 36

Collect like terms

d1- - d1+ = 36 - 18 - 8

d1- - d1+ = 10

For the above equation to be true, the following inequality must be true

d1- > d1+

Hence,

(d) is correct

Because:

10 > 0

Alex, a web designer, is assigned the task of creating a mobile device-friendly website for a leading fashion outlet called AllStyles. A desktop version of AllStyles's website already exists. Alex can refer to this desktop version of the website to create the mobile website design The desktop version of the website contains a long list of hyperlinks and this can obstruct the view of the main content when Viewed from a mobile device. Which of the following should Alex use to hide this long list of hypertext links so that it appears only in response to a tap of a major heading in the navigation list?
a. Navigator menus
b. Pulldown menus
c. Pop-up links
d. Header links

Answers

Answer: Pulldown menus

Explanation:

Pulldown menus refer to the graphical control element, that is identical to a list box, which enables user to be bake to select one value from a list.

They're regarded as the menu of options that will appear when an item is selected with a mouse. In this case, the item that the user selected will show at the top of the display screen, while the menu appears will show below it.

Therefore, Alex should use the pulldown menus to hide the long list of hypertext links so that it appears only in response to a tap of a major heading in the navigation list.

pleeeese help me for these questions

Answers

1 Account

2 online

3 access

4 password

5 internet

6 email

Determine whether or not the following pairs of predicates are unifiable. If they are, give the most-general unifier and show the result of applying the substitution to each predicate. If they are not unifiable, indicate why. Assume that x, y, and z are variables, while other symbols are either predicates, constants, or functions.
a) P(B,A,B), P(x,y,z)
b) P(x,x), Q(A,A)
c) Older(Father(y),y), Older(Father(x),John).
d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B)
e) P(f(x), x, g(x)), P(f(y), A, z)

Answers

Answer:

a) P(B,A,B), P(x,y,z)

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }.

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q.

c. Older(Father(y),y), Older(Father(x),John)

Thus , mgu ={ y/x , x/John }.

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B.

e) P(f(x), x, g(x)), P(f(y), A, z)    

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

Explanation:  

Unification: Any substitution that makes two expressions equal is called a unifier.  

a) P(B,A,B), P(x,y,z)  

Use { x/B}  

=> P(B,A,B) , P(B,y,z)  

Now use {y/A}  

=> P(B,A,B) , P(B,A,z)  

Now, use {z/B}  

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }  

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q  

c. Older(Father(y),y), Older(Father(x),John)  

Use {y/x}  

=> Older(Father(x),x), Older(Father(x),John)  

Now use { x/John }  

=> Older(Father(John), John), Older(Father(John), John)  

Thus , mgu ={ y/x , x/John }  

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))  

Use { y/x }  

=> Q(G(x,z),G(z,x)), Q(G(x,x),G(A,B))

Use {z/x}  

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B  

e) P(f(x), x, g(x)), P(f(y), A, z)  

Use {x/y}  

=> P(f(y), y, g(y)), P(f(y), A, z)  

Now use {z/g(y)}  

P(f(y), y, g(y)), P(f(y), A, g(y))  

Now use {y/A}  

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

Write a single Python regular expression for each of the following. Note: For each problem, you must use only ONE regular expression.
Matches a string that has both the substring dog and cat in the string in either order. For instance, both of the following strings match: 'The dog chased the cat' and 'xxcatxxdogxx'.

Answers

Matches a string that has both the substring dog and car in the string in either order

Think about that the C, B and S parameters of a Cache. Think about what happens to compulsory, capacity, conflict misses, if only each of the following parameter changed (the other two are kept the same)?
(i) C is increased (S, B same)
(ii) S is increased (C, B Same)
(iii) B is increased (C, S Same)

Answers

Answer:

(i) C is increased (S, B same)

Explanation:

Cache are items which are stored in the computer at a hidden place. These are sometimes unwanted and they may hinder the speed and performance of the device. They exist to bridge speed gap.

The following program generates an error. Why? #include #include using namespace std; class Arcade { public: Arcade(); Arcade(string name, int r); void Print(); private: string arcName; int rating; }; Arcade:: Arcade() { arcName = "New"; rating = 1; } Arcade:: Arcade(string name, int r) { arcName = name; rating = r; } void Arcade:: Print() { cout << "Name is: " << arcName << endl; cout << "Rating is: " << rating << " stars" << endl; } int main() { Arcade myArc(Games Ablaze, 5); myArc.Print(); }

Answers

Answer:

The object creation should be Arcade myArc("Games Ablaze",5);

Explanation:

Required

Why does the program generate an error?

The class definition is correctly defined and implemented;

The methods in the class are also correctly defined and implemented.

The error in the program is from the main method i.e.

int main() {  

       Arcade myArc('ames Ablaze, 5);  

       myArc.Print();  

   }

In the class definition;

Variable name was declared as string and variable rating was declared as integer

This means that, a string variable or value must be passed to name and an integer value or variable to rating.

Having said that:

Arcade myArc(Games Ablaze, 5); passes Games Ablaze as a variable to th function.

Game Ablaze is an incorrect string declaration in C++ because of the space in between Game and Ablaze

Also, no value has been assigned to the variable (assume the variable definition is correct).

This will definitely raise an error.

To correct the error, rewrite the object creation as:

Arcade myArc("Games Ablaze",5); where "Game Ablaze" is passed as string

Write a c++ program to find;
(I). the perimeter of rectangle.
(ii). the circumference of a circle.

Note:
(1). all the programs must allow the user to make his input .
(2).both programs must have both comment using the single line comment or the multiple line comment to give description to both programs.​

Answers

Answer:

Perimeter:

{ \tt{perimeter = 2(l + w)}}

Circumference:

{ \tt{circumference = 2\pi \: r}}

Just input the codes in the notepad

Which one of these statements about digital signatures is true? A digital signature:
a. Is used to add a personal touch to e-mail messages.
b. Automatically encrypts the contents of an e-mail.
c. Is a scanned image of your real signature.
d. Is used to verify the identity of the sender of a message.​

Answers

Answer:

A. Is used to add a personal touch to e-mail messages.

Explanation:

A digital signature—a type of electronic signature—is a mathematical algorithm routinely used to validate the authenticity and integrity of a message (e.g., an email, a credit card transaction, or a digital document). ... Digital signatures are significantly more secure than other forms of electronic signatures.

Regarding the role played by the “victim” in deadlock resolution, give an example of such a deadlock in real life and explain your answers to these questions.

a. Describe how you might choose the victim to be removed and the consequences, both positive and negative, of that removal.

b. Describe the fate of the victim and the chances of eventually completing its processing.

c. Describe the actions required, if any, to complete the victim’s tasks. ​

Answers

Answer:

Here the answer is given as follows,

Explanation:  

The real-life situation of a deadlock resolution where a role is played by the victim is given as follows:  

Example: An example of such a situation are often a one-way lane where the flow of traffic is merely in a method. Thus, on just one occasion, the flow of traffic can enter one direction only. Each entrance/exit gate is often considered a resource. during this case, if two cars are coming from both the entrances and that they are often considered as two tasks, then one among the cars must copy or we will say hand over its resource in order that the opposite car gets the prospect to first cross the lane or we will say the opposite task gets executed.  

 a)  Victim: The steps which describe how a victim is chosen are given as follows :  

   The task which is terminated so as to interrupt things of deadlock is taken into account because of the victim.

There are often a variety of job pools that will be under a deadlock situation and therefore the victim is usually a low-priority task in order that the performance isn't affected that much and termination of this task doesn't cause any effect on the opposite jobs.

the main positive effect of selecting and terminating a victim is that things of deadlock are resolved and every one of the tasks can execute now.

The negative effect is that the task that's chosen because the victim is terminated and is executed at the previous. This whole process for choosing a victim then terminating it then restarting it again may consume some longer also.

b)  An easy deadlock priority is often set. this suggests that the victim’s task or the task is often terminated so as to interrupt the deadlock and other jobs can finish executing. After this, the task which is terminated are often later restarted and every one of the tasks can then execute without a deadlock.

 c) When employment gets terminated, the knowledge associated with it's stored. Are often This is often done in order that the work can be restarted again and therefore the information in it's not lost. Since the progress of the victim is stopped. Thus, the sole thanks to complete the victim’s task would be to start out it again. But before restarting the task, this must be considered that the victim’s task doesn't cause any deadlock within the system.  

what's the difference between pseudo code and natural language​

Answers

Answer:

The pseudo-code describes steps in an algorithm or another system in plain language. Pseudo-Code is often designed for human reading rather than machine reading with structural conventions of a normal language of programming.

Natural languages consist of phrases, usually declarative phrases, with a sequence of information.

Explanation:

Pseudo-Code is often designed for human reading rather than machine reading with structural conventions of a normal language of programming. It usually omits information that is essential to the understanding of the algorithm by the machine, for example, variable declarations and language code.Easily human, but not machines, use the natural languages (like English).Natural languages also are creative. Poetry, metaphor, and other interpretations are permitted. Programming permits certain style differences, but the significance is not flexible.The aim of using pseudo-code is to make it easier for people to comprehensibly than standard programming language code and to describe the key principles of an algorithm efficiently and environmentally independently. It is usually used for documenting software and other algorithms in textbooks and scientific publications.

Identify the hardware components in your own computer. If you don't have a computer, use a friend's, or one at work or in an NVCC lab. The following list shows the components you should identify and how to find the information on a Windows computer. Describe model computer: type (laptop, desktop, notebook, tablet, etc.) Indicate your manufacturer (HP, Apple: iPad, MacBook Air, etc., Lenovo, Dell, etc.) of the computer. Input devices (include internal and external devices) - they usually have a model name and number somewhere on the device. Output devices (include internal and external devices) - they usually have a model name and number somewhere on the device. Storage devices (include internal and external devices, and how much data each can hold) - Open Windows Explorer and right click on a drive name to open its properties. Amount of RAM - Open System Properties in the Windows Control Panel. Type and speed of CPU - Open System Properties in the Windows Control Panel. Ports (number and type) - Look for jacks into which a connector can be plugged on the front, back and sides of the machine. Compare the jacks to pictures in your textbook.

Answers

Solution :

A friend of mine have an old version of computer PC having the following components :

Input devices

Model name of the keyboard -- PUNTA , model number -- P-KB515

Model name of the mouse -- PUNTA, model number -- P-KB515

Output devices

Speaker : COMPAQ

Monitor : ACER,  Model Number  --- EB192Q

Storage : 500 MB capacity hard disk

RAM : 2 GB

Processor : Intel Pentium dual E1260 at the rate 1.80 GHz

It is provided with audio jacks

How is an API different from a web application?

Answers

Answer:

Web services (web application) are an API type to be accessed via a network connection. While APIs are application interfaces, this means standardized communication between one application and another application.

Explanation:

Web service is used for communication with REST, SOAP, and XML-RPC.

        While API for all communication styles is used.

The APIs are all web services. Whereas web services are not APIs.The Web application has no lightweight design, needs a SOAP agreement for sending or receiving system information. While the architecture is lightweight, API is useful for gadgets with limited transmission capacities like smartphones.The web application supports the HTTP protocol only. Whereas the API HTTP/s protocol supports: URL Request / Answer Header etc.The web application is not open source, but any customer who contains XML can devour it. While API  is open-source and has a .net framework.

job evaluation for technical consultant​

Answers

There is no question. Why is this telling me incorrect
There is no question

When you have access to a multiuser computer system, what responsibilities do you have when selecting your password?

Answers

Answer:

The responsibilities you have are Use characters other than just AZ. If passwords are chosen from the letters AZ, there are only 26 possibilities for each character. Adding digits expands the number of possibilities to 36. Using both uppercase and lowercase letters plus digits expands the number of possible characters to 62

Explanation:

Hoped this helped you :3

different between internet and email​

Answers

Answer:

The internet allows you to connect with people and information around the world. The internet is more broad and could include searching things up or message-based websites. Emails is more specific, with it being when you send someone a message (called an email) on a mail website (that allows you to get messages from other people, websites, etc.)

Explanation:

In my answer.

Saved In order to be used as a primary key, which of these characteristics must an attribute possess with respect to a single instance of the entity? Select all that apply. There must be a maximum of one attribute instance. There must be many instances of the attribute There must be at most one entity instance that each attribute instance describes. There must be at least one instance of the attribute. There must be zero or more instances of the attribute. Question 2 (2 points) True or false: A singular attribute is also known as a unique attribute. True False Question 3 (3 points) Saved Relationship names and types of relationship maxima or minima that each could have are listed below. Match each relationship in the list below to the type of relationship maxima or minima. Instructions: Choose your responses from the drop-down menus below. Response options cannot be used more than once. Minima is One-Zero 1 Person-Assigned Social SecurityNumber 4 Minima is Zero Zero 2 CubicleNumber-Assigned-to- Employee per shift 2 Maxima is One-Many 3. Birthdate-Recorded-for-a Person 1 Maxima is One One 4. Women-Bearing-Children Question 4 (2 points) Saved A ride-sharing app's discount system for riders is configured such that a ride discount is triggered only if at least two RiderlDs book a ride in the same Card at the same time. Which of the following is true of the relationship Ride Discount-is-Applicable?
The relationship minimum is Many-One.
The relationship minimum is Two-One.
The relationship maximum is One-Two.
The relationship minimum is One-Two.

Answers

Answer:

Saved In order to be used as a primary key, which of these characteristics must an attribute possess with respect to a single instance of the entity:

There must be a maximum of one attribute instance.

There must be many instances of the attribute.

There must be at most one entity instance that each attribute instance describes.

There must be at least one instance of the attribute.

A singular attribute is also known as a unique attribute. True

Saved Relationship names and types of relationship maxima or minima that each could have are listed below. True

Explanation:

In this lab, you complete a prewritten C++ program that computes the largest and smallest of three integer values. Instructions Two variables named largest and smallest are declared for you. Use these variables to store the largest and smallest of the three integer values. You must decide what other variables you will need and initialize them if appropriate. Your program should prompt the user to enter 3 integers. Write the rest of the program using assignment statements, if statements, or if else statements as appropriate. There are comments in the code that tell you where you should write your statements. The output statements are written for you. Execute the program by clicking the Run button at the bottom of the screen. Using the input of -50, 53, 78, your output should be: The largest value is 78 The smallest value is -50

Answers

Answer:

The program in C++ is as follows

#include <iostream>

using namespace std;

int main(){

   int n1, n2, n3, largest, smallest;

   cin>>n1>>n2>>n3;

   if(n1 >= n2 && n1>=n3){        largest = n1;    }

   else if(n2 >= n1 && n2>=n3){        largest = n2;    }

   else{        largest = n3;    }

   if(n1 <= n2 && n1<=n3){        smallest = n1;    }

   else if(n2 <= n1 && n2<=n3){        smallest = n2;    }

   else{        largest = n3;    }

   cout<<"Smallest: "<<smallest<<endl;

   cout<<"Largest: "<<largest<<endl;

   return 0;

}

Explanation:

Declare all variables

   int n1, n2, n3, largest, smallest;

Get input for the three numbers

   cin>>n1>>n2>>n3;

Check if n1 is the largest

   if(n1 >= n2 && n1>=n3){        largest = n1;    }

Check if n2 is the largest

   else if(n2 >= n1 && n2>=n3){        largest = n2;    }

Otherwise, n3 is the largest

   else{        largest = n3;    }

Check if n1 is the smallest

   if(n1 <= n2 && n1<=n3){        smallest = n1;    }

Check if n2 is the smallest

   else if(n2 <= n1 && n2<=n3){        smallest = n2;    }

Otherwise, n3 is the smallest

  else{        largest = n3;    }

Print the smallest

   cout<<"Smallest: "<<smallest<<endl;

Print the largest

   cout<<"Largest: "<<largest<<endl;

An array A[0..n - 2] contains `n-1` integers from 1 to `n` in increasing order. (Thus one integer in this range is missing.) Design an algorithm in $\Theta(\log n)$ to find the missing integer. Your algorithm should be given in **pseudo code**. For example, the array `A` could be `{1, 2, 3, 4, 6, 7, 8, 9, 10}` in which `5` is missing.

Answers

Answer:

I do not understand anything

In a paragraph, describe in detail a practical real-world example of where you would implement a singly-linked list and why a singly-linked list is best for this use. Do not list the properties of a singly-linked list....
Rather identify a real-world example or application. If you identify this through research, cite your source.

Answers

Answer:

travel

Explanation:

One real world example of a singly-linked list would be travel. Imagine that you want to take a trip to your nearest neighbor state. To do so you would need to take a 2 buses and a train, but you can't just take any or in any order you wish. You first need to take the first bus at your current location, get off at the train station, take that train to the final stop, get off and take the bus to the final destination. Meaning there is a sequence of connected events that you must follow in order to get to your destination and the same opposite sequence of events to get back. This is exactly like a singly-linked list.

Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their average as integers (rounded), then as floating-point numbers. Output each rounded integer using the following: print('{:.0f}'.format(your_value)) Output each floating-point value with three digits after the decimal point, which can be achieved as follows: print('{:.3f}'.format(your_value))

Answers

Answer:

The program is as follows:

prod = 1

isum = 0

for i in range(4):

   num = float(input())

   prod*=num

   isum+=num

avg = isum/4

print('{:.0f}'.format(prod))

print('{:.3f}'.format(avg))  

Explanation:

This initializes the product to 1

prod = 1

..... and sum to 0

isum = 0

The following iteration is repeated 4 times

for i in range(4):

Get input for each number

   num = float(input())

Calculate the product

   prod*=num

Add up the numbers

   isum+=num

This calculates the average

avg = isum/4

Print the products

print('{:.0f}'.format(prod))

Print the average

print('{:.3f}'.format(avg))  

Functions should contain only the code that performs a single task.
O True
O False

Answers

Answer:

false

Explanation:

function should contain more codes

what are the physical aspect of a presentation​

Answers

Answer:

1. It has a clear objective.

2. It's useful to your audience.

3. It's well-rehearsed.

4. Your presentation deck uses as little text as possible.

5. Your contact information is clearly featured.

6. It includes a call-to-action.

Explanation:

The input to the function/method consists of two arguments.

a. True
b. False

Answers

Answer:

See Explanation

Explanation:

The function is not given. So, I will provide general explanation.

A function is defined as:

return-type function-name(argument-lists)

For instance, an int function that has 1 argument is:

int Myfunc(int num)

num is the argument of the function Myfunc

So, an example of a function with two arguments is:

int Myfunc(int num, string name)

So, examine the function in the complete question; then count the number of arguments to determine if the answer is true or false.

Other Questions
Hari is accused ........... stealing money. Solve the equation below : 7/8 = q + 1/2 A : q = 3/8 B : q = 1 3/8 C : q = 7/16 D q = 1 3/4 Anita is concerned that shell be diagnosed with type 2 diabetes. What type of lifestyle changes could she make to help prevent this diagnosis You HAVE 1L of 2.0 mol/L HCI. You want to dilute the solution to a concentration of 0.1 mol/L. What volume of the new solution (V2)?0.05 LO 20L0.2 L 57:27 Which initiatives are pillars of the Let's Move! Program? Select three options. increasing physical activity providing more snack times in schools creating a healthy start for children empowering parents and caregivers providing children with vitamin supplements Which statement best describes the areas and perimeters of the figures below? Question 25 of 252 PointsWhich story premise most clearly contains a supernatural element?A. Two teens decide to dress up like video game characters forHalloweenB. Every time Evelyn writes a name in her diary, that persondisappears.C. King Baldric's knights swear to protect him from his rival, PrinceAldor.O D. The attorney always wears her lucky watch when she goes into atrial. use the definition (meaning of the compound words) then complete with compound words. 1. The paper which used for given answer from the original question paper is ____ give me a smart goals to achieve At the beginning of the period, the Assembly Department budgeted direct labor of $60,500 and property tax of $26,000 for 5,500 hours of production. The department actually completed 6,800 hours of production. Determine the budget for the department, assuming that it uses flexible budgeting. $ fill in the blank 1 Triangle KLM is similar to triangle NOP. Find the measure of side OP. Round your answer to the nearest tenth if necessary How vulnerable How vulnerable is the human body? I was told to never be afraid of anyone Find the value of x in the triangle shown below In the given figure alongside,prove thatTriangle ABC is simalar to Triangle SRTFind the length of AC Malik and Janae are practicing making free throws at the basketball court. Malik makes 3 baskets for every 4 shots he takes. Janae makes 4 baskets for every 5 shots she takes. Which number accurately completes the table? They have money. (affirmative to negative sentence) Purchases Budget in Units and Dollars Budgeted sales of The Music Shop for the first six months of 2010 are as follows: Month Unit Sales Month Unit Sales January 130,000 April 200,000 February 170,000 May 180,000 March 190,000 June 250,000Beginning inventory for 2010 is 40,000 units. The budgeted inventory at the end of a month is 40 percent of units to be sold the following month. Purchase price per unit is $6. Prepare a purchases budget in units and dollars for each month, January through May. What is the objective of finacial reporting Write a paragraph in French of 8 to 10 sentences describing your bizarre friend in detail. Make sure to mention at least 8 different parts of the body in your description. If you want to expand your paragraph, you can also talk about your friend's personality, likes, dislikes, hobbies, etc. The goal is to have fun and be creative, using the French words you know. Is Mercury is a gas giant, and because it is hot, it is named after the mercury in a thermometer. Please give real answers with explaination. I will follow + I will give brainliest. No Docs/No Files/No Links only answer with explaination.