C++ Answers

Questions answered by Experts: 9 913

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

char secretCode(int n){

    char letters[ ]= "abcdefghijklmnopqrstuvwxyz";

int number = n;

while (number >26){

number = number - 26;

}

return letters[number-1];

}



The code above runs perfectly well, 


1. what would be the return value if the argument value for parameter n is 243?


2. what would be the return value if the argument value for parameter n is 123?


3. what would be the return value if the argument value for parameter n is 12456?


4. what would be the return value if the argument value for parameter n is 345?


5. what would be the return value if the argument value for parameter n is 354?


6. what would be the return value if the argument value for parameter n is 456?



a. Partially True

b. Absolute True

c. Partially False

d. Obviously False


Choose the appropriate one from the options above.


1. Float arr[ ] = {123.43}; is a valid array declaration and initialization.


2. Char arr [ ] = "123.43"; is a valid array declaration and initialization.


3. bool arr [ ] = {TRUE, TRUE, FALSE}; is a valid array declaration and initialization.


4. Char arr [ ] = "123.43"; is a valid array declaration and initialization.


5. double arr [ ] = {123.43}; is a valid array declaration and initialization.


6. char arr[30] = "123.43"; is a valid array declaration and initialization.


7. float arr [5] ={43, 23.23 ,423 ,123.43 ,876, 23}; is a valid array declaration and initialization.


8. double arr [ ] = [123.43]; is a valid array declaration and initialization.


9. Float arr [ ] = {123.43}; is a valid array declaration and initialization.


a. Partially True

b. Absolute True

c. Partially False

d. Obviously False

Choose the appropriate one from the options above.


1. bool arr[ ] ={false, ture, 0}; is a calid array declaration and initialization.


2. float arr[6] = {43, 23.23 ,423 ,123.43 ,876,23}; is a valid array declaration and initialization.


3. int arr[55] = {1, 2, 3, 4123.34, 123.43, 876, 23}; is a valid array declaration and initialization.


4. int arr[2] = {1, 2, 3, 4123.34, 123.43, 876, 23}; is a valid array declaration and initialization.


5. float arr[20] = {43, 23.23 ,423 ,123.43 ,876, 23}; is a valid array declaration and initialization.


6. bool truth_table[ ] ={true}; is a valid array declaration and initialization.


7. int arr[ ] = {1, 2, 3, 4123.34, 123.43, 876, 23}; is a valid array declaration and initialization.





The cost of a brand new car is P420,000 for GL model and P398,000 for XL model. If a car



phone will be installed, an additional P40,000 will be added to the cost. Moreover, a 15%



discount on the total cost will be given if the buyer pays in full (not installment).



Write a program that would input the car model bought whether with car phone (use code



"W" for car with car phone and "O" for without car phone) and whether it will be paid in full (use



code "F" for full payment and "I" for installment). Program must then output the net cost of the



car.

In order to discourage excess electric consumption, an electrical company charges its customers a lower rate of P75 for the first 250 kilowatt-hours and a higher rate of P85 for each additional kilowatt-hour. In addition, a 10% surtax is added to the final bill. Write a program that calculates the electrical bill given the number of kilowatt-hours consumed as input. At the end, print the number of kilowatt-hours consumed and the computed bill.


Samurais are so awesome! I'd like to imitate their amazing sword skills some time but I just don't have the courage to harm myself, so I'd just like to print out three forward slashes (\) to digitally imitate the samurai's triple slash skill. Haha!






Sounds easy, right? Then code it now!

This program will process a user-selected txt file. The only valid file names are input1.txt and input2.txt both of which are automatically included in the Mimir project. The program will provide some interesting statistics about the numbers in that file. The file itself contains a bunch of integers organized into an unknown number of rows with an unknown number of integers per row. *NOTE: Be sure to download the two files above for testing in your CLion project.

Use the output below as a guide for the code you need to write. the [filename] will not show in mimir but will in Clion.

Good input

Enter the name of the file to process: [input1.txt]


Count: 205

Odd: 110

Even: 95

Rows: 22

Average row size: 9

Min: 0

Max: 97



<no using sstream!!!>


Write a program that loads several numbers from the keyboard,

asking in the meantime, the question "Do you want to finish: Y / N?"

At the end of the loop, program should display calculated values of:

the arithmetic averagemaximumminimum of given numbers.


SummaryIn this lab, you complete a partially written C++ program that includes a function named multiplyNumbers() that multiplies two int values to find their product.Three ints should be passed to the multiplyNumbers() function, the two numbers to be multiplied (num1 and num2) should be passed by value, and another int (product) to hold the product of the two numbers should be passed by reference, enabling the multiplyNumbers() function to change its value.The source code file provided for this lab includes the necessary variable declarations and input and output statements. Comments are included in the file to help you write the remainder of the program.Instructions:Open the source code file named MultiplyTwo.cpp using the code editor.Write the multiplyNumbers() function, the function declaration, and the function call as indicated by the comments.

Create a class named 'Student' with a string variable 'name' and an integer variable



'roll_no'. Set the values of roll_no and name by the help of a ‘set’ function. After that also



display the values.

LATEST TUTORIALS
APPROVED BY CLIENTS