Write a program that reads an integer and determines and prints whether it is odd or even. [Hint: Use the remainder operator. An even number is a multiple of two. Any multiple of two leaves a remainder of zero when divided by 2.].
can you do this program without using classes
u can use functions instead of classes
Registration System
1. Press 1 to login
2. Press 2 to register students
3. Press 3 to see the list of fee defaulters
4. Press 4 to see the CGPA of student
5. Press 5 to see the pre requisite of a course.
6. Press 6 to exit the system
Registration Window
Enter student ID
The student should not be a fee defaulter if yes then do not register student
The pre requisite of course should be passed. if fail do not register for the course
If the students CGPA is a above 3.0 register all courses.
If the CGPA is above 2.0 register 3 courses.
If CGPA less than 2.0 then register 2 courses with a warning.
Student information Window
The data should be saved in a file.
The student record may be deleted.
The student record may be searched based on the ID provided.
The student record may be updated in case if its phone no or house address changes.
Registration Window
Enter student ID
The student should not be a fee defaulter if yes then do not register student
The pre requisite of course should be passed. if fail do not register for the course
If the students CGPA is a above 3.0 register all courses.
If the CGPA is above 2.0 register 3 courses.
If CGPA less than 2.0 then register 2 courses with a warning.
Write a list of book using structures defining parameters. (5 at least)
o Name (String) – Topic (String) – Pages (int) – IsEnglishLanguage (bool) – Price
(float)
Take input of number 12008988 in the University using appropriate data type. Write a
programme to print all the prime number digits, each in a new line. In this number
Q2: When will the ‘while’ loop be preferred over the for loop? Mention the scenario and write the
programme to demonstrate this.
class Node
{
public int key;
public Object data;
public Node left;
public Node right;
}
Node* search(Node root, int key)
{
if (root == null)
return null;
else if (key == root->key)
return root->data;
else if (key < root->key)
return searchTree(root->left, key);
else
return searchTree(root->right, key);
}
Rewrite this function iteratively instead of recursion
Requirements :
No global decelerations
Test run in main
Assignment 2
A company that wants to send data over the Internet has asked you to write a program that will encrypt the data so that it may be transmitted more securely. All the data is transmitted as four-digit integers. Your application should read a five-digit integer entered by the user and encrypt it as follows: Replace each digit with the result of adding 6 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the fourth, and swap the second digit with the fifth. Then print the encrypted integer.
Write a separate application that inputs an encrypted four-digit integer and decrypts it (by reversing the encryption scheme) to form the original number.
Write algorithm using pseudocode and flowchart that uses while loops to perform the
following steps:
i.
Prompt the user to input two integers: firstNum and secondNum note that firstNum
must be less than secondNum.
ii.
Output all odd numbers between firstNum and secondNum.
iii.
Output the sum of all even numbers between firstNum and secondNum.
iv.
Output the numbers and their squares between firstNum and secondNum.
v.
Output the sum of the square of the odd numbers between firstNum and secondNum.
b. Redo Exercise (a) using for loops.
c. Redo Exercise (a) using do. . .while loops.
Write a program that first reads an integer for the array size,
then reads characters into the array, and displays the consonants (i.e., a character
is displayed only if it a consonant). (Hint: Read a character and store it to an array
if it is not a vowel. If the character is a vowel, discard it. After the input, the array
contains only the consonants.)