[solved] – Question 98039

#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


[solved] – Question 98043

How do I code this?
a.A method called setName that prompts for a child’s name and returns it:

Expert Answer


[solved] – Question 98051

Design and write a C++ program which accepts an amount of money entered in dollars. if amount is greater than or equals to 1000 dollars, a 5% discount is given to the customer. it should also display the amount the customer has to pay

Expert Answer


[solved] – Question 98053

Design and write a C++ program which accepts an amount of money entered in Kshs. if amount is greater than or equals to 1000 Kshs, a 5% discount is given to the customer. it should also display the amount the customer has to pay

Expert Answer


[solved] – Question 98071

Write a for loop to print the numbers from 20 to 30, inclusive (this means it should include both the 20 and 30). The output should all be written out on the same line.

Sample Run
20 21 22 23 24 25 26 27 28 29 30

Expert Answer


[solved] – Question 98074

Write a loop to print 11 to 35 inclusive (this means it should include both the 11 and 35), 5 per line.

Sample Run
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

Expert Answer


[solved] – Question 98098

Edhesive Code Practice 2.8:
Write a program that takes three numbers as input and prints the largest.

Enter a number: 20
Enter a number: 50
Enter a number: 5
Largest: 50

Expert Answer


[solved] – Question 98104

Create
template <typename T> void prioritized_insert(T& new_item) to the LinkedList class.

This function must make some checks before inserting the element into the list to keep the list sorted in descending order according to the Processes’ priority. High priority means high importance and vice versa

#define LOW_PRIORITY 0
#define MEDIUM_PRIORITY 31
#define HIGH_PRIORITY 63

Expert Answer


[solved] – Question 98123

Define the relation jump( Square1, Square2) according to the knight jump on the chessboard. Assume that Square1 is always instantiated to a square while Square2 can be uninstantiated. For example:
?- jump( 1/1,S).
S= 3/2;
S= 2/3;
No

Expert Answer


[solved] – Question 98129

Using the classes designed in Programming Exercises 6 and 7, write a
program to simulate a bookstore. The bookstore has two types of customers:
those who are members of the bookstore and those who buy books from the
bookstore only occasionally. Each member has to pay a $10 yearly membership fee and receives a 5% discount on each book purchased.
For each member, the bookstore keeps track of the number of books
purchased and the total amount spent. For every eleventh book that a
member buys, the bookstore takes the average of the total amount of the
last 10 books purchased, applies this amount as a discount, and then resets the
total amount spent to 0.
Write a program that can process up to 1000 book titles and 500 members. Your
program should contain a menu that gives the user different choices to effectively
run the program; in other words, your program should be user driven.

Expert Answer