If you are trying to print a string, what happens if you leave out one of the quotation marks or both and why?
Draw a UML class diagram. Create a CollegeCourse class. The class contains fields for the course ID (for example, “CIS 210”), credit hours (for example, 3), and a letter grade (for example, ‘A’). Include get and set methods for each field.
Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4).
Next, create a set method that sets the value of one of the Student’s CollegeCourses; the method takes two arguments—a CollegeCourse and an integer representing the CollegeCourse’s position (0 through 4). Save the files as CollegeCourse.java and Student.java.
write programm Array in user password vesual
Create a flowchart to guide you in the process
Create a function that will accept the value of i and return the value of n
Possible values of i is any positive value from 2 to 10
n is computed based on the value of i; see the following table for the sample Input / Output
i Process n
3 1*2*3 6
5 1*2*3*4*5 120
7 1*2*3*4*5*6*7 5040
Come up with a domain name that you would like to register for yourself. Do a
research and find two domain name sellers and compare their prices.
NOTE: you don't need to purchase the domain.
1)First company web address:…….Price……
2)Second company web address:……Price….
Which company will you go for and why:
1. (a) What will be the output for the following program C code?
#include<stdio.h>
int main()
{
int a=12, b=4, c;
++a;
b++;
c=a++ - b;
printf(“ %d %d %d\n ”, a, b, c);
return 0;
Create a class called Numbers, which has a single class attribute called MULTIPLIER, and a constructor which
takes the parameters x and y (these should all be numbers).
(a) Write a method called add which returns the sum of the attributes x and y.
(b) Write a class method called multiply, which takes a single number parameter a and returns the product
of a and MULTIPLIER.
(c) Write a static method called subtract, which takes two number parameters, b and c, and returns b - c.
(d) Write a method called value which returns a tuple containing the values of x and y. Make this method
into a property, and write a setter and a deleter for manipulating the values of x and y.
Reduce the digits:
You are given a positive integer N, write a program to repeatedly add the digits of the number until the number becomes a single-digit number.
Input:
The input should be a single line containing a single-digit number.
Output:
The output should be a single line containing a single-digit number.
Explanation:
In the example, the given number is 92. As the number is more than a single digit, repeatedly add the digits like
9+2=11
1+1=2
Profit Trade:
You are given a list of prices, where prices[i] is the price of the given stock on the i th day. Write a program to print the maximum profit by choosing a single day to buy a stock and choosing a different day in the future to sell that stock. If there is no profit that can be achieved, return 0.
Input:
The input should be a single line containing space-separated integers.
Output:
The output should be a integer.
Explanation:
In the example, the given prices are 7,1,5,3,6,4
Buying stocks on day two having price 1 and selling them on the fifth day having price 6 would give the maximum profit which is 6-1
So the output should be 5.
closest even digits number:
Given an integer N, write a program to print the closest number that has all the even digits. Consider the lowest number if there is same difference between forward and backward numbers.
Input:
The input is a single line containing an integer N.
Output:
The output should be a single line containing the closest integer , that has all even digits.
Explanation:
In the example, the number is 17. The closest number that has all even digits in it is 20. So the output should be 20.