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

Write a statement or a set of statements to accomplish each of the following:

>Sum the odd integers between 1 and 99 using a For/Next structure. Assume that variables sum and count have been declared explicitly as Integer.

>Print the number from 20 to 1 on the form using a Do Until loop and Integer counter variable x. Assume that the variable x is initialized to 20.

>Print the Integers from 1 to 20 using a Do/Loop While structure and the counter variable x. Assume that x has been declared as an integer but not initialized.



Reverse Alternate Words in Sentence

Given a sentence, write a program to reverse the alternate words in the sentence and print it.

Reverse the first word and respective alternative words.

Input

The input will be a single line containing a sentence.

Output

The output should be a single line containing the sentence with the alternate words reversed.

Explanation

For example, if the given sentence is

Sun rises in the east and sets in the west The alternate words which need to be reversed are (Sun, in, east, sets, the), by reversing these words the output should benuS rises ni the tsae and stes in eht west


Sample Input 1

Sun rises in the east and sets in the west


Sample Output 1

nuS rises ni the tsae and stes in eht west


Sample Input 2

The car turned the corner


Sample Output 2

ehT car denrut the renroc




Suppose that the input is:

58 23 46 75 98 150 12 176 145 -999

What is the output of the following program?

import java.util.*;

public class FindTheOutput

{

static Scanner console = new Scanner(System.in);

public static void main(String[] args)

{

int num;

num = console.nextInt();

while (num != -999)

{

System.out.print(num % 25 + " ");

num = console.nextInt();

}

System.out.println();

}

}



Write a C++ program which perform the following:

1. Create a Class Sequence

2. Create a Private Static Data Member and initialize it with value 

zero

3. Create a Public Static Member Function, funcStatic( ) to access 

the static data member

4. Now, access the static member function in Main(), and using 

Constructor print the following sequence:

0 1 3 6 10 15 21 28


Write a C++ program which perform the following:

1. Create a Class factorial

2. Create Private Member Variable and initialize it with Member 

initialization list and with value zero

3. Now, take inputs from user

4. Create a Public Member Function Calculate( ) outside the class, 

to calculate the factorial of a given input

5. Create another Public Member Function Result( ) outside the 

class, to print the results on screen

6. Now, create a constant object of the class which perform following: 

a. Passes the values to the Calculate( ) function 

b. Call the Result( ) function to show result


write a program that ask for two numbers, compare them and show the maximum. Declare a function called max two that compares the numbers and returns the maximum


You are hired to create a program that lets the user play with the string data type. This program will have many features and you will ask the user which feature does he wants to use. For this first you need to create a menu, display the user with the choices that he has and what does he need to enter in order to use that feature.

The features to be included are

Feature 1:Let’s the user prints his name, and asks him is it am or pm, and print the message accordingly

Hi, name, Good Morning

Hi, name, Good Evening

Feature 2

Ask the user to enter two strings and then compare both of them to see if the entered strings are same and not. Display the message appropriately.

Feature 3

Ask the user to enter a sentence in a string and write a program to find a substring within a string. If found display its starting position.

Feature 4

Ask the user to enter a word, and then display letter of word on separate lines.

For example if user inputted “Hello”, it should be displayed like

H

E

L

L

0



1. Write a program to store integer elements in an array named test of size 10 with initial values (5,9,57,3,9,21,57,6,9,3) and print it.

 2. Modify the program to read to display the array contents in reverse order. 

 3. Modify the program to find the sum of all elements of the array. 

4. Modify the program to copy the elements from the test array into another array named testcopy. 

8. Modify the programs to count and display the frequency of each element of array test.

9. Modify the program to find the maximum and minimum element in array test.  



Write a function power(a, b), to calculate the value of a raised to b, using: (a) non-recursive method (b) recursion 


Write a program to take the values of two integers and use pointers to add 10 to the value of each integer. 


LATEST TUTORIALS
APPROVED BY CLIENTS