Justify whether it is possible to design an expanding opcode to allow the following to be encoded in 16-bit instruction? An address is 4 bits.
15 instructions with three addresses
14 instructions with two addresses
31 instructions with one address
18 instructions with zero address
Write a program having class STRING, With data member which can store character array (Dynamically you can store). It should facility to initialize by parameterize constructor and concatenate STRING objects.
Ex: STRING obj1(“OOP”), obj2 (“IN KIIT”);
Obj1 = obj1 + obj2;
Then obj1 should have “ OOP IN KIIT” string in it.
Hari, Priya, Poorna and Chandra goes for shopping and purchases 5 items each. The cost of each person is stored in the array. Hari want to create a separate array for each members. Help Hari to create separate array, one for Hari, one for Priya, one for Poorna and one for Chandra.
Question1
Write a C++ program for simple voting system.The program should display ELIGIBLE VOTER when age entered is 18 or more.Else the program should display NOT ELIGIBLE VOTER
QUESTION TWO
As an elder brother/sister write a C++ program for your junior siblings to perform some mathematical operations. The program should receive the first name,age and class of your sibling. The program should welcome him or her with the first name when entered together with a message(example;welcome Richard to basic maths program).
The program should allow him or her to perform area of trapezium when age is above 12 and class is class 5 or above. Else he or she should be allowed to perform perimeter of a rectangle.
Note: All inputs must be entered by the user and not assigned by the programmer.
Question ) Implement an object oriented ’Character’ class to capture the common attributes and actions of all characters in your game.
Code) Read input from the keyboard to let the user provide values for your character’s attributes of a specific character object (not a superclass object) your code will create.
Code) Since the user could mistype or introduce problems with their typed input, handle all exceptions with exception handling as part of your character data gathering code.
Code) Create a superclass character object, and call its attack method to demonstrate its use
1) Implement an object oriented subclass of Character, to simulate a specific kind of character in your game. For example, a ’warrior’ class. A warrior is a character, but a character is not necessarily a warrior.
2) Include one unique data field for an attribute of the specific character that is not inherited or defined in Character class
3) Implement a method which overrides the Character attack method to make your subclass simulate a more specific kind of attack that relates to its type, with informative printouts
1) Implement an object oriented ’Character’ class to capture the common attributes and actions of all characters in your game. No need to make this class or the subclass public.
2) Declare two data fields for attributes of the character, one textual and one numeric.
3) Implement a constructor method to initialize data fields and set up the character object .
4) Since all characters can attack, implement a method to simulate the character object attacking in some generic way, including informative printouts
a) You have sub-netted your class C network 200.138.1.0/?? with a subnet mask of 255.255.255.224. Please list the following: number of networks, number of hosts per network, the full range of the first three networks, and the usable address range from those first three networks. Additionally, identify the broadcast addresses for each network.
Write a C program to find the area of circle using preprocessor directives.
Create a base class called Shape which has two double type values. Use member function getdata() to get the values. Use a virtual function display_area() to display the area. Derive two specific classes called Triangle and Rectangle from the base class Shape. Redefine display_area() in the derived classes. Write a program that, based on the user's choice, creates a rectangle or triangle object during runtime, points that object with a Shape class pointer, and calls the display_ area() method with that pointer.