[solved] – Question 82115

Write a program that first imports the math standard library. The program then defines a function called log_e that has one parameter called power_of_e. In the function, pass the parameter to the log function of the math module and assign the returned value to a variable called exponent. The last statement in the function should return exponent.

After the function and outside the function, write a statement to read a number from the keyboard, convert it to float and assign it to a variable called my_number. Next, write a print statement that has enclosed in the print parenthesis a call to log_e passing my_number to log_e. The output should be to three decimal places using format() function.

An example of running your program is as follows:

Enter a number and I will give you it’s natural logarithm: 5

1.609

Expert Answer


[solved] – Question 82118

1a.Implement maketree, setleft, and setright for right in-threaded binary trees using the sequential array representation. 1b. Implement inorder traversal for this right in-thread tree.

Expert Answer


[solved] – Question 82149

Create a program that satisfy the following requirements:
1.Ask user to enter integer numbers, one at a time.
2.If the number is -1, stop entering number.
3.Print out the total number that is greater than 18.

For example:
The following is screen shot when user enters the sentence “computer science is great”.

enter an integer:
13
enter an integer:
2
enter an integer:
21
enter an integer:
40
enter an integer:
-1
Total number that is greater than 18: 2

Expert Answer


[solved] – Question 82160

The Harrison Group Life Insurance company computes annual policy premiums based on the age the customer turns in the current calendar year. The premium is computed by taking the decade of the customer’s age, adding 15 to it, and multiplying by 20. For example, a 34-year-old would pay RM360, which is calculated by adding the decades (3) to 15, and then multiplying by 20. Write C++ program that prompts a user for the current year and a birth year. The program calculates and display the premium amount. Save the application as Question2.cpp

Expert Answer


[solved] – Question 82236

DressingRooms class
•Define a class with a constructor that takes number of rooms as a parameter.
•The default constructor will use three rooms as the default.
•Use a semaphore object.
•Provide a method to wait and access next available room.
Customer class
•Constructor is included with a number of clothing items parameter.
•Use a random number when the number of items is not
Scenario class
•Accept the number of rooms and customers as parameters
•Create the rooms.
•Create the customers.
•Keep track of results.
Scenario00
Define a test using these parameters:
•10 customers
Scenario01
Define a test using these parameters:
•20 customers
Scenario02
Define a test using these parameters:
•20 customers

Expert Answer


[solved] – Question 82241

Q1. To display ASCII value until user will not strike the enter key.
Q2. To count the character until user does not strike the enter key.
Q3. To check marks validation using do while loop. (Do-While)
Q4. To print the message “Red” 10 times using for loop.
Q5. To print all Capital Alphabetic keys using for loop.
Q6. To print first five odd numbers using for loop.
Q7. To print the sum of given numbers using for loop.

Expert Answer


[solved] – Question 82269

The University sports club is organizing a running competition. All participants are required
to run 3 races: 400m, 200m, and 100m sprints. The sports club requires a system to record the
performance times of all participants for each of the 3 running events. The sports club also
wants to record the registration number and the age of each participant

Expert Answer


[solved] – Question 82318

Write a static method that accepts an array of LineSegments and returns the longest of the line segments. If the array is null, or empty, return null.

(Your answer to this should be a single method. No need to write a whole class.)

Expert Answer


[solved] – Question 82321

a function return the minimum distance between indices of an array that have adjacent values,the function should return -1 if the minimum distance is greater then 100,000,000. the function should return -2 if no adjacentindices exist

Expert Answer


[solved] – Question 82342

Display ascii value until user will not strike enter key

Expert Answer