Homework Answers

Math 50414 50414
Physics 44332 44332
Chemistry 40988 40988
Economics 30643 30643

Questions: 207 418

Answers by our Experts: 207 418

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

What happens after reactant molecules collide?

Differentiate the types of moving particles (normal, slow and fast moving particles) when they approach each other before collision, during collision and after collision.

Instructions:



1. In the code editor, you are provided with a main() function that asks the user for 4 integer inputs and passes these to the getBest() function call.


2. Your task is to declare and define this getBest() function which has the following details:


Return type - int


Name - getBest


Parameters - 4 integers


Description - returns the highest integer passed


DO NOT EDIT ANYTHING IN THE MAIN


Input



1. First integer



2. Second integer



3. Third integer



4. Fourth integer



This is the given code:



#include <iostream>


using namespace std;



int main(void) {


int a, b, c, d;



cout << "Enter a: ";


cin >> a;



cout << "Enter b: ";


cin >> b;



cout << "Enter c: ";


cin >> c;



cout << "Enter d: ";


cin >> d;



cout << "Highest integer = " << highest;



return 0;


}

Instructions:



1. Your task is to ask the user for a character input.


2. Then, include the cctype built-in library and call the toupper() function. In case you do not know what this function is, this function has the following definition:


Return type - int


Name - toupper


Parameter - one integer which represents the ASCII of a character


Description - returns the ASCII of the uppercase equivalent of the character passed


Extra note - even though it's function definition in the C++ Programming Language Documentation is int toupper(int ch), you can just pass a normal char variable instead and this will just be automatically typecasted/converted to its integer equivalent.


3.Once you get the uppercase equivalent, print this out.



Input


1. Letter to be updated

Instructions:




1. You are provided with the isLeapYear() function which is already declared and defined for you.



2. Your task is to ask the user for a year and then call the isLeapYear function to check whether the year is a leap year or not.



Input




1. Year to be checked




Output




If a certain year is a leap year, print "<INSERT_YEAR_HERE> is a leap year"



Otherwise, print "<INSERT_YEAR_HERE> is not a leap year"




Sample Output:



Enter·year:·2020



2020·is·a·leap·year




This is the given code:




#include <iostream>



using namespace std;




int isLeapYear(int);




int main(void) {



// TODO: Write your code here




return 0;



}




int isLeapYear(int n) {



if(



(n % 4 == 0 && n % 100 != 0) ||



(n % 100 == 0 && n % 400 == 0)



) {



return 1;



}




return 0;



}

A spring 20cm long is stretched to 25cm by a load of 50N. What will be it's length when stretched by 100N assuming that the elastic limit is not reached

Instructions:


1. In the code editor, you are provided with a main() function that asks the user for an integer input n, and passes this value to the function call of the generatePattern() function.


2. Your task is to implement this generatePattern() function which has the following description:


Return type - void


Function name - generatePattern


Parameters - 1 integer n


Description - this function prints a triangular pattern of letter T's based on the value of n. For more information, refer to the output in the test cases


3.DO NOT EDIT ANYTHING IN THE MAIN



Input



1. Integer n



This is the given code:



#include <iostream>


using namespace std;



int main(void) {


int n;



cout << "Enter n: ";


cin >> n;



generatePattern(n);



return 0;


}

1. In the code editor, you are provided with a main() function that asks the user for 2 characters, passes these characters to a function call of the getHigherValue() function, and then prints out the ASCII value of the higher character.


2. Your task is to implement the getHigherValue function which has the following details:


Return type - int


Name - getHigherValue


Parameters - 2 characters to be compared


Description - the ASCII value of the higher character.


3. Hint: Comparing characters in C++ is just like comparing integers.


4. DO NOT EDIT ANYTHING IN THE MAIN


Input



1. First character



2. Second character



This is the given code:



#include <iostream>


using namespace std;



int main() {


char a, b;



cout << "Enter first character: ";


cin >> a;



cout << "Enter second character: ";


cin >> b;



cout << "Result value = " << getHigherValue(a, b);



return 0;


}

One electron and one proton of a hydrogen atom are at a distance of 2.2✕10−11m apart. What is the potential energy, in joules, of the electron in the proton’s field?




An increase in supply tends to increase the equilibrium price and quantity?



LATEST TUTORIALS
APPROVED BY CLIENTS