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 C++ program to sum the values in the file with respect to the input of the user. The file contains a set of numerical inputs. Read all the inputs from the file and calculate the sum of odd and even numbers based on the choice of the user.


Sample Format of the file.txt file,

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Constraints:

Find the sum of odd numbers if the choice is 1.

Find the sum of even numbers if the choice is 2.


Get the choice from the console and display the output in the console.


Input Format:

Read an integer(choice) as an input from the console. 

To sum value from the file, read the content as input from the file (file.txt)



Sample Input and Output 1 :

Enter the choice

1.Odd

2.Even

1

The total of all numbers is 64


Create a class MusicalInstruments which contains methods void play(), String getDescription(),float getPrice().play() need not be given a definition in MusicalInstrument. Derive classes StringInstr and Percurssion from MusicalInstruments. StringInstr contains method, int getNoOfStrings(). Percurssion contains method, String getType(). Create class Violin that inherits from StringInstr. Create class Tabla that inherits from Percurssion.

Write main() to test the classes and to illustrate run-time polymorphism.

In main() create an object of Tabla with appropriate data values and print it.


you have a musical friend ? , If no then sorry you cannot join . If yes , then what instrument you can play , if it is drum or guitar then welcome to the band if none than ,sorry

You cannot join the band .


use string and bool in programming


Create a class MusicalInstruments which contains methods void play(), String getDescription(),float getPrice().play() need not be given a definition in MusicalInstrument. Derive classes StringInstr and Percurssion from MusicalInstruments. StringInstr contains method, int getNoOfStrings(). Percurssion contains method, String getType(). Create class Violin that inherits from StringInstr. Create class Tabla that inherits from Percurssion.

Write main() to test the classes and to illustrate run-time polymorphism.

In main() create an object of Tabla with appropriate data values and print it.


Discuss the conceptual systems design process in the SDLC and the activities in this phase. (10 marks)


Create a list which contains integer elements and then perform insert,delete,display, search and exit operations

Create a program that when run with a name, an integer and a double as CMD arguments, it prints out a greeting using the name and also print the difference of the two given numbers:

Sample run 1:               

java Lab01_task85 John 25 18.65

Output: Good day John.

The difference between 25 and 18.650 = 6.35


Create a program that when run with a name, an integer and a double as CMD arguments, it prints out a greeting using the name and also print the difference of the two given numbers:

Sample run 1:               

java Lab01_task85 John 25 18.65

Output: Good day John.

The difference between 25 and 18.650 = 6.35


Write a program to implement the stack using an array and link list both.
Note: The code should have the modularity and should include following function apart from
main ():
 Push() This function inserts an element to top of the Stack.
 Pop() This function deletes an element from top of the Stack.
 Display() This function displays all the elements of the Stack by popping them one by
one.
Write a program to implement the following algorithm:
 Start with two indexes one at the left and other at the right end of the array.
 Left index simulate the first stack and second index simulate the right stack.
 If we want to put the element in the first stack then put the element at the left index.
Similarly, if we want to put the element in the second stack then put the element at the
right index.
 First stack grow towards left and second stack grow towards left.
A simple demonstration of dual stack can be observed from the following figure:
Stack A empty space stack B
1 2 3 4 [ ] [ ] [ ] 6 7 8 9
----> <-----
Entering elements Entering elements From this side From this side
LATEST TUTORIALS
APPROVED BY CLIENTS