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 are the specific proffessional ethics related to augmented reality,artificial intelligence and internet of things?


Masking - 2

Write a program that reads a single line of input and prints the first two and last two characters of the given input and prints the asterisk character (*) in place of the remaining characters.

Explanation

For example, if the given string is

message, then the first two and last two characters are me, ge. Now replacing all the remaining characters with * will give the output me***ge.


Write strassen matrix multiplication for nxn matrix in c++.
Diamond

Given an integer value 

N, write a program to print a number diamond of 2*N -1 rows as shown below.

Input

The first line of input is an integer 

N.

Explanation

In the given example, the number of rows in the diamond is 

5.

So, the output should be

. . . . 0 . . . . 
. . . 0 0 0 . . . 
. . 0 0 0 0 0 . . 
. 0 0 0 0 0 0 0 . 
0 0 0 0 0 0 0 0 0
. 0 0 0 0 0 0 0 . 
. . 0 0 0 0 0 . . 
. . . 0 0 0 . . . 
. . . . 0 . . . .
Sample Input 1
5
Sample Output 1
. . . . 0 . . . . 
. . . 0 0 0 . . . 
. . 0 0 0 0 0 . . 
. 0 0 0 0 0 0 0 . 
0 0 0 0 0 0 0 0 0 
. 0 0 0 0 0 0 0 . 
. . 0 0 0 0 0 . . 
. . . 0 0 0 . . . 
. . . . 0 . . . .
Sample Input 2
4
Sample Output 2
. . . 0 . . . 
. . 0 0 0 . . 
. 0 0 0 0 0 . 
0 0 0 0 0 0 0 
. 0 0 0 0 0 . 
. . 0 0 0 . . 
. . . 0 . . .

please given correct output and . also should me included.

Compare Last Three Characters

Write a program to check if the last three characters in the two given strings are the same.

Input

The first and second lines of inputs are strings.

Output

The output should be either

True or False.Explanation

Given strings are

apple, pimple. In both the strings, the last three characters ple are common. So the output should be

True


Elements in the Range

You are given three numbers. Check if any of the numbers exist in the range from 10 to 20 (including 10 and 20).

Input

The first, second, and third lines of input are integers.

Output

The output should be either

True or False.Explanation

Given

a = 2, b = 4, c = 16, 16 is in the range between 10 and 20.So the output should be

True


Write a program to print all the LEADERS in the array. An element is leader if it is greater than all the elements to its right side. And the rightmost element is always a leader. For example in the array {16, 17, 4, 3, 5, 2}, leaders are 17, 5 and 2.


Flow control is one of the main building blocks that determines how a program should run. Ghana Cocoa Growing company wishes to compare the impart of two newly acquired fertilizers on cocoa. They will do this by applying the same quantity of the two fertilizers on two similar but different cocoa plant under the same conditions (humidity, sunlight, soil moisture etc.). They will then choose the fertilizer whose crop produces the best harvest (highest quantity per square feet). As a programmer, 

c. create a method that takes four arguments i.e. (the names of the two fertilizer and their individual yields). The methods should return the name of the fertilizer with the greatest yield.  

    

d. Using “c” above, write a program that request for two fertilizer name and their respective yields. Your program should display the fertilizer with the most yield   

e. Discuss your answer in “d” above


Problem 5: Suppose there is a list s1->s2->s3->………->sn-1 ->sn. given to you. You need to modify this list in such a way that it will be s1->sn ->s2->sn-1 ->s3->sn-2……. Note: algorithm should be inplace without modifying the values of the nodes. Marking Scheme: Total 10 marks ( Algorithm explanation + Pseudo-code + runtime and data structure used)


Use the following driver program to test your classes InsurancePolicy and CarInsurance:
#include <iostream> #include <fstream> #include "Insurance.h" #include "CarInsurance.h" using namespace std;
int main() {InsurancePolicy myPolicy(123456, "Peter Molema", 3450.67);
CarInsurance yourPolicy(456891, "Wilson Ntemba", 5550.67,
15000.00);
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
myPolicy.showPolicy(cout);
cout << endl;
yourPolicy.showPolicy(cout);
cout << endl << "AFTER UPDATES:" << endl;
myPolicy.setPolicy(123456, "Peter Molema", 5450.67);
yourPolicy.setPolicy(456891, "Wilson Ntemba", 6650.67,
25000.00);
myPolicy.showPolicy(cout);
cout << endl;
yourPolicy.showPolicy(cout);
cout << endl;
return 0;
}
LATEST TUTORIALS
APPROVED BY CLIENTS