The wavelength of a signal transmitted at 1000MS-1 is 700M. Determine the period of the transmission
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.
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
First Run Server.py on the HOST side and run Client.py on the User side
After running Client.py on the User side I need four functions that the user side runs: REGISTER user, Display Registered users, De-register User
To Register a user to the Host server (aka Connect to the host server) you must have the input: “REGISTER <username (any name)>, <IP address of that user that wants to register> <PORT #s (range limit is 49152 through 65535)>”
After running the REGISTER COMMAND, it will either output “REGISTERED” or “NOT REGISTERED” on the user client-side If “REGISTERED” output is displayed, the User client should now be connected to the Host Server and Host Server can either save registered(connected) users in a list/database and/or output on Host Server-side “Connection at <username of user client> <IP ADDRESS of user client> <port # of user client (range limit is 49152 through 65535 >”
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.