Create a class named TestClass that holds a single private integer field and a public constructor. The only statement in the constructor is one that displays the message “Constructing”. Write a main()function that instantiates one object of the TestClass. Save the file as TestClass.cpp in the folder. Run the program and observe the results
Write a Java code Using Arraylist and Inheritance.
Input Sample
Enter number of presidents: 5
Enter class president id: 10
Enter class president id: 20
Enter class president id: 30
Enter class president id: 40
Enter class president id: 50
Output :
power on class 10
power on class 20
power on class 30
power on class 40
power on class 50
power on school
Best president id: 10
or
Input
Enter number of presidents: 2
Enter class president id: 45
Enter class president id: 23
output :
power on class 45
power on class 23
power on school
Best president id: 45
or
Input:
Enter number of presidents: 0
output:
power on school
A. write pseudocode algorithm to determine the integral of a function between two specified points using the rectangular rule. B. write C++ computer programs to determine the integral of a function between two specified points using the rectangular rule
You have been tasked with designing a computer program solution that is expected to determine the placements of metal beams, which will be used as part of a supporting barrier along newly constructed highways are expected to be 55 feet or more in length write a c++ programming language, implement a computer program solution that will accept the length of a highway and the distance between beams and then determine and output the amount of beams that will be required for creating the highways support barrier. Your solution must use a user defined function to display the positioning of each beam. All the metal beams will be K feet apart, such that 5 _<, K _<15. Your user-defined function function will return the total amount of beams that are required to the function that called it. Your computer program must output the total amount of beams before it terminates
You have been tasked with designing a computer program solution that is expected to determine the placements of metals beams, which will used as part of a supporting barrier along newly constructed highways. Highways are expected to be 55 feet or more in length.
Required: Using the C++ programming language, implement a computer program solution that will accept the length of a highway and the distance between beams and then determine and output the amount of beams that will be required for creating the highway's support barrier. Your solution must used a user-defined function to display the positioning of each beam. All metal beams will be k feet apart, such that 5 < k < 15. Your user-defined function will return the total amount of beams that are required to the function that called it. Your computer program must output the total amount of beams before it terminates.
char letter = 'A';
Write a single line of code to convert and print the ASCII integer value of the variable letter.
Example Output
65
1. Write a program to input co-efficients of a, b and c of a quadratic equation ax2 + bx + c = 0, where a = 0. Discriminant, D = b2- 4ac.If discriminant is 0 then print there is exactly one real root, if discriminant is positive then print there are two distinct roots, if discriminant is negative then print then there are no real roots.
1. Write a program to input a year in 4-digit form and check whether it is a leap year or not and display proper message.
Write a program that emulates a soft drink vending machine.
Use an if-else-if block to handle a menu of the following options:
1) Coke, 2)Sprite, 3) Sprite, 4) Ice tea.
Output Example
Vending Machine
1) Coke
2) Sprite
3) Water
4) Ice tea
Select: 4
You selected an Ice tea.Write a program using OpenCL to do the following: Host code. O Create two STL vectors, named vecl and vec2. Initialise their contents as follows: vecl: A vector of ints that contains 32 elements. Initialise the elements with random values between 10 and 20. vec2: A vector of ints that contains 16 elements. Initialise the first half of the vector with values from 2 to 9 and the second half with values from -9 to -2. Create and initialise the necessary memory objects to pass vecl and vec2 as input to the kernel, and another memory object for kernel output. o Enqueue the kernel such that each work-item will process 8-elements from vecl, respectively, i.e. work-item 1 will refer to elements 0-7, work-item 2 will refer to elements 8-15, etc. After kernel execution, obtain the output from the kernel and display the results on O o screen.