Exp1:
import java.util.Scanner;
public class User_Authentication
{
public static void main(String args[])
{
String username, password;
Scanner s = new Scanner(System.in);
System.out.print("Enter username:");//username:user
username = s.nextLine();
System.out.print("Enter password:");//password:user
password = s.nextLine();
if(username.equals("Bisha") && password.equals("Computer"))
{
System.out.println("Authentication Successful");
}
else
{
System.out.println("Authentication Failed");
}
}
}
Exp3:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Main {
static Scanner sc=new Scanner(System.in);
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws IOException {
// TODO code application logic here
System.out.print("Enter any String: ");
String str = br.readLine();
System.out.print("\nEnter the Key: ");
int key = sc.nextInt();
String encrypted = encrypt(str, key);
System.out.println("\nEncrypted String is: " +encrypted);
String decrypted = decrypt(encrypted, key);
System.out.println("\nDecrypted String is: "
+decrypted); System.out.println("\n");
}
public static String encrypt(String str, int key)
{ String encrypted = "";
for(int i = 0; i < str.length(); i++) {
int c = str.charAt(i);
if (Character.isUpperCase(c)) {
c = c + (key % 26);
if (c > 'Z')
c = c - 26;
}
else if (Character.isLowerCase(c)) {
c = c + (key % 26);
if (c > 'z')
c = c - 26;
}
encrypted += (char) c;
}
return encrypted;
}
public static String decrypt(String str, int key)
{ String decrypted = "";
for(int i = 0; i < str.length(); i++) {
int c = str.charAt(i);
if (Character.isUpperCase(c)) {
c = c - (key % 26);
if (c < 'A')
c = c + 26;
}
else if (Character.isLowerCase(c)) {
c = c - (key % 26);
if (c < 'a')
c = c + 26;
}
decrypted += (char) c;
}
return decrypted;
}
}
need your help regarding attached for all the questions
Answered it from your mind Do not copying the Answered Especially "D"
In: Computer Science
a. Create a SLL for N Data by using front insertion.
b. Display the status of SLL and count the number of nodes in it
c. Perform Insertion and Deletion at End of SLL
d. Perform Insertion at the third position.
e. Delete the element at the Front of SLL
f. Perform Deletion at second position of SLL
g. Display the content.
Linked List (SLL) of Student Data with the fields: USN, Name, Branch, Sem, PhNo
a. Create a SLL of N Students Data by using front insertion.
b. Display the status of SLL and count the number of nodes in it
c. Perform Insertion and Deletion at End of SLL
d. Perform Insertion and Deletion at Front of SLL
e. Display the content.
a. Create a DLL for N Data by using front insertion.
b. Perform Insertion and Deletion at End of DLL
d. Perform Insertion at the third position.
e. Delete the element in the Front of SLL
f. Perform Deletion at second position of SLL
g. Display the content.
In: Computer Science
Write a program that meets the following requirements:
Cat Class
- name
- breed
- number of legs
- year born
There should be NO main method in the Cat class.
CatTester Class
In: Computer Science
Q2.1 Write a Java program called Div that takes 2 (two) double command-line arguments as inputs, dividend and divisor (in that order) and performs a division operation. Your program either prints the quotient or an error if the divisor is zero. The divisor is the number you divide the dividend by.
public class Div
{
public static void main ( String[] args )
{
// WRITE YOUR CODE HERE
}
}
Q2.2
Write a Java program called IntCheck that examines the integer variable x, printing GT (greater than) if x is greater than 100, LT (less than) if x is less than 100 and EQ (equal) if x is 100.
public class IntCheck { public static void main ( String[] args ) { int x = Integer.parseInt(args[0]); // WRITE YOUR CODE HERE } }
In: Computer Science
Python Programming Problem:
If I have to separate lists, one contains a large string of paragraphs of words, and one contains just words, how can i iterate the words in my second list and compare it to my paragraph list to see how many times that word has occurred?
List1 = ['paragraph.......']
List2 = ['words', 'words', 'words'......]
these are just minimal examples
how do i approach this problem?
apprently numpy helps with processing time for something like this? cuz the lists could get quite big
In: Computer Science
Reflect on how the concepts and material presented in this Foundations of Research course can be used in your future academic endeavors. Include a specific example of a concept or assignment that you found most beneficial.
In: Computer Science
Please write code in c++ using iostream library.
Write a function bool cmpr(char * s1, int SIZE1, char * s2, int
SIZE2) that compares two strings.
Input
Input contains two strings. Each string is on a separate line.
example:
aqua
aqua
Output
Output YES if given two strings are the same or NO otherwise.
YES
In: Computer Science
Write in JAVA eclipse program (comment in every line):
class for calculating an area of a room. The program MUST ask for the length and the width of the room.
Make sure you write the methods to get the width and length and print the area.
In: Computer Science
Write a C++ program to simulate a service desk. This service desk should be able to service customers that can have one of three different priorities (high, medium, and low). The duration for any customer is a random number (between 5 minutes and 8 minutes). You need to write a program that will do the following:
Tips: Use a loop that will process 100 times, se each service request as an index for the queue, declare random numbers to generate priorities and service times, 5-8 for service, 1-3 for priority, generate 2 deques: one for service, 1 for priority, use push_front(high) and push_front(low) to add values to the deque, for medium priority use size()/2 to find the missle position of the deque using insert(name.insert(position, value).
In: Computer Science
Your order from store Your orders are 10 chips You purchased a total of 10 chips with a total price of $90 5 gums You purchased a total of 5 gums with a total price of $30 Question: Please create a code to allow you to remove one or more of your orders (in python3 language)
In: Computer Science
**PLEASE ANSWER ALL QUESTIONS**
Calliope is a forensics detective with a law enforcement agency. She discovers that an attacker who has just been caught was using a dead-drop method of controlling the bots in a botnet. Which of the following might have been a clue that the attacker was using this method?
| a. |
Finding devices that the attacker had hidden on multiple victims’ company networks |
|
| b. |
Finding a directional antenna and Wi-Fi setup that allowed the bot herder to beam communications directly to the target computers |
|
| c. |
Finding an e-mail account with multiple saved drafts that were never sent but contained instructions the bots were to follow |
|
| d. |
Reading log files that contained constant encrypted communications from the attacker’s IP address to some of the identified bots |
Belvais performing an audit of the e-mail server when she discovers that one of the accounts is sending a lot of e-mails all day that contain attachments. After a bit more research, she finds that the attachments contain extensive proprietary and confidential information. Which of the following should she consider implementing to prevent a reoccurrence?
| a. |
Buffer filtering |
|
| b. |
DLP |
|
| c. |
PoS |
|
| d. |
Access point probe |
Alika has just finished eradicating a piece of malware from a computer system. Which of the following might she do next as part of the validation process?
| a. |
Secure erase |
|
| b. |
Patching |
|
| c. |
Reconstruction |
|
| d. |
Reimaging |
Jaden has received an alert from a system that has identified potential malware on itself. Upon looking through the log files, he sees a list of error messages where an executable tried to write data to a range of memory addresses that did not exist for the system. Which of the following has most likely occurred?
| a. |
Space overflow |
|
| b. |
Decimal overflow |
|
| c. |
Buffer overflow |
|
| d. |
Integer overflow |
Victoria, a cybersecurity analyst, has just disconnected a computer from the network after finding that it was infected with malware. Which of the following is the next task that she should attempt to perform with the system?
| a. |
Containment |
|
| b. |
Patching |
|
| c. |
Eradication |
|
| d. |
Validation |
In: Computer Science
SQL is our language for relational databases - do you think it's an adequate "language" for database creation and manipulation?
In: Computer Science
By using javaFX as the GUI, design and implement java based algorithms using appropriate data structures for the following problem:
Use depth-first search to find paths to all the vertices in a graph that are connected to a given start vertex s. A sample input file containing the number of vertices, number of edges and a list of edges called tinyCG.txt is provided for you to test your program.
In: Computer Science
Write a program that reverses a text file by using a stack. The user interface must consist of 2 list boxes and 3 buttons. The 3 buttons are: Read - reads the text file into list box 1. Reverse - reverses the items in list box 1 by pushing them onto stack 1, then popping them from stack 1 (in the reverse order) and adding them to list box 2. Write - writes the contents of list box 2 to a new text file. At first, only the Read button is enabled. After it is clicked, it is disabled and the Reverse button is enabled. After it is clicked, it is disabled and the Write button is enabled. After it is clicked, it is disabled. The name of the input text file is "input.txt". The input text file will contain no more than 100 lines of text. This fact is not needed by the program. It simply means that memory usage is not an issue. The name of the output text file is "output.txt". Notes: 1. The name of your main class should be ReverseFileViaStack. 2. Use the Java class library Stack class for your stack. 3. Use a border layout for your contents pane. 4. In the north region include the following title: Reverse a Text File via a Stack. 5. Use a panel in the center region to contain the 2 list boxes (side-by-side). 6. Place the 3 buttons in the south region. 7. A useful resource for this project is the week 5 video: Java GUI List Components
In: Computer Science
In Linux system, explain step by step what the following commands do:
mkdir test
cd test
cp /etc/fstab .
ls
ls -l
touch foo ./-l
ls
ls -l
Then execute the following command:
ls *
Explain the result. What is the problem?
Execute the following command:
rm *
Explain the result. What is the problem?
Modify the "rm *" command so that it works correctly. Explain your solution.
In: Computer Science