[solved] – Question 97899
Write a program that prompts the user to input two numbers, a numerator and a divisor. Your program should then divide the numerator by the divisor, and display the quotient and remainder.
Expert Answer
[solved] – Question 97909
plot a sine wave and a cosine wave over one period Make a time vector t from 0 to 2p with enough samples to get smooth lines
Expert Answer
[solved] – Question 97914
write and run a c++ program if hours is greater than or equal to 40 and the salary is 12.00 per hour, then the worker works for above 40 hours and the salary is 480.00 plus 18.00 then ask the user to input hours and the total salary is the output
Expert Answer
[solved] – Question 97928
You are required to design an algorithm which calculates budget expenses of a family ,Your algorithm should ask for the number of children he/she has then ask for the monthly expenses of each child like(tution fee,school fee, Van charges etc) calculate total expenses and average expense of each child. Your program terminates when user enters ‘#’.
Expert Answer
[solved] – Question 97982
Write a program that accepts a time as an hour and minute. Add 15 minutes to the time, and output the result.
Expert Answer
[solved] – Question 97994
Write a loop that inputs words until the user enters “STOP.” After each input, the program should number each entry and print in this format:
#1: You entered _____
When “STOP” is entered, the total number of words entered should be printed in this format:
All done. __ words entered.
Expert Answer
[solved] – Question 9800
For this task you will create a Subject class, whose instances will represent the subjects for study at a university. A subject will have a name, just a String, and a subject code, which is a six-character String. The first three characters of a subject code are alphabetic and the last three are numeric. The first three characters define the subject’s discipline area. A subject code must be unique.
You will also write a TestSubject class to test the use of your Subject class. In particular this will maintain an array of subjects. In order to manage the uniqueness of the subject codes, your program will need to display information about existing subject codes as well as checking that any new subject code supplied by the user is not the same as any existing subject code.
The following state and functionality should be provided for the Subject class:
Two fields will hold the subject’s name and the six-character subject code.
A constructor will allow a name and a new, validated subject code to be provid
Expert Answer
[solved] – Question 98003
Suppose an alien giant walks with decreasing steps (stride length). Each step is half of his last step. Write a function to calculate how far the alien giant can go with known steps if the giant’s very step is one mile. Test your program with different numbers of steps to observe the results. With how many steps can the alien giant go more than two miles? Extra points will be given if you can find the result mathematically.
(Hint: Total distance = 1 + 1/2 + 1/4 + 1/8 + …)
double walk(int steps)
{
double totalDistance;
//Fill in here
return totalDistance;
}
int main()
{
//Sample function calls. You might change the number of steps to test how far the giant can go
cout << “With 10 steps the giant walked ” << walk(10) << ” miles.” << endl;
cout << “With 30 steps the giant walked ” << walk(30) << ” miles.” << endl;
return 0:
}
Expert Answer
[solved] – Question 98011
Write a program that prompts the user to input two numbers, a numerator and a divisor. Your program should then divide the numerator by the divisor, and display the quotient (integer only) and remainder.
Expert Answer
[solved] – Question 98038
#include <iostream>
#include <string>
using namespace std;
string to_string(string array[], int size);
int main()
{
const string alpha = “abcdefghijklmnopqrstuvwxyz”;
const int SIZE = 26;
string letters[SIZE];
for (int i =0; i<SIZE; i++)
{
char letters[SIZE] = {‘a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’,’j’,’k’,’l’,’m’,’n’,’o’,’p’,’q’,’r’,’s’,’t’,’u’,’v’,’w’,’x’,’y’,’z’};
cout<<letters[SIZE];
}
cout << to_string(letters, SIZE) << endl;
}
/**
Returns a string array as a delimited string.
@param a the array of strings.
@param size the size of the array.
@return a string of the elements, separated by
commas and surrounded by [].
*/
string to_string(string a[], int size)
{
string result = “[“;
if (size > 0)
{
result = result + “”” + a[0] + “””;
for (int i = 1; i < size; i++)
{
result = result + “, “” + a[i] + “””;
}
}
result = result + “]”;
return result;
}
Expert Answer

