Questions
Write a pro-active password checker that checks to make sure that a user entered password meets...

Write a pro-active password checker that checks to make sure that a user entered password meets certain requirements. You must implement a simple program that prompts the user for two String values, a password and the same password again for confirmation. For the purposes of this lab, a legal password must have all of the following properties:

▪ Length of at least 8 characters

▪ Starts with a lower case letter

▪ Ends with a numerical digit

▪ Has one Uppercase

▪ Is exactly equal to the repetition of the password typed for confirmation

Complete your program to prompt the user to enter a password and a confirmation as explained above. If the password is shorter than 8 characters, print Password is too short! Otherwise, if the password does not start with a lower case letter, print Password must start with a lower case letter! Otherwise, if the password does not end with a digit, print Password must end with a digit! Otherwise, if the password does not match the confirmation, print Passwords do not match! If there is no Uppercase letter in the password print Password must contain uppercase letter! Finally, if all the conditions are satisfied, print Password is valid!

Must be in Java

In: Computer Science

Hello, I am just having a hard time understanding this question. The question is below. I...

Hello, I am just having a hard time understanding this question. The question is below. I am not supposed to write a program but instead in regular english sentence form just name the methods, fields, and variables I would use for this loan class. Im not really sure what a loan class means as well, thank you for your help.

USING JAVA Given a Loan class, name the necessary fields and methods that we would need in this class. Be creative in your naming of variables and methods.

In: Computer Science

Using Python 3, define mySum function that supposed to return the sum of a list of...

Using Python 3, define mySum function that supposed to return the sum of a list of numbers (and 0 if that list is empty), but it has one or more errors in it. Write test cases to determine what errors there are.

In: Computer Science

Python Knapsack Problem: Acme Super Store is having a contest to give away shopping sprees to...

Python Knapsack Problem:

Acme Super Store is having a contest to give away shopping sprees to lucky families. If a family wins a shopping spree each person in the family can take any items in the store that he or she can carry out, however each person can only take one of each type of item. For example, one family member can take one television, one watch and one toaster, while another family member can take one television, one camera and one pair of shoes.

Each item has a price (in dollars) and a weight (in pounds) and each person in the family has a limit in the total weight they can carry. Two people cannot work together to carry an item. Your job is to help the families select items for each person to carry to maximize the total price of all items the family takes. Write an algorithm to determine the maximum total price of items for each family and the items that each family member should select.

***In python:***

Implement your algorithm by writing a program named “shopping.py”. The program should satisfy the specifications below.

Input: The input file named “shopping.txt” consists of T test cases

T (1 ≤ T ≤ 100) is given on the first line of the input file.

Each test case begins with a line containing a single integer number N that indicates the number of items (1 ≤ N ≤ 100) in that test case

Followed by N lines, each containing two integers: P and W. The first integer (1 ≤ P ≤ 5000) corresponds to the price of object and the second integer (1 ≤ W ≤ 100) corresponds to the weight of object.

The next line contains one integer (1 ≤ F ≤ 30) which is the number of people in that family.

The next F lines contains the maximum weight (1 ≤ M ≤ 200) that can be carried by the ith person in the family (1 ≤ i ≤ F).

Output: Written to a file named “results.txt”. For each test case your program should output the maximum total price of all goods that the family can carry out during their shopping spree and for each the family member, numbered 1 ≤ i ≤ F, list the item numbers 1 ≤ N ≤ 100 that they should select.

Sample Input from input file

2

3

72 17

44 23

31 24

1

26

6

64 26

85 22

52 4

99 18

39 13

54 9

4

23

20

20

36

Sample Output:

Test Case 1

Total Price 72

Member Items

1: 1

Test Case 2

Total Price 568

Member Items

1: 3 4

2: 3 6

3: 3 6

4: 3 4 6

In: Computer Science

How Heapify is done (theory, pseudocode, and examples) the examples used Java code please

How Heapify is done (theory, pseudocode, and examples) the examples used Java code please

In: Computer Science

1. Explain how two controls can be set up to share the same event handler. How...

1. Explain how two controls can be set up to share the same event handler. How can the event handler tell which control generated the event?

2. Which user action generates three separate mouse events? Which events? Why?

3. Compare and contrast event handlers and change listeners.

Hello, I would really appreciate it if these 3 questions could be explained to me. These are in reference to the JAVA programming language. Specifically the JAVA GUI. I greatly appreciate a clear and understandable explanation. I WILL NOT BE COPY AND PASTING YOUR ANSWERS. Instead, I want to learn so I can form it in my own words.

In: Computer Science

Java Program. !ONLY USING WHILE LOOPS! (Completed but with errors, wanted to revise could anyone re-create...

Java Program. !ONLY USING WHILE LOOPS!

(Completed but with errors, wanted to revise could anyone re-create this?)

Write a program to keep track of the number of miles you have driven during an extended vacation and the number of gallons of gasoline you used during this time, recorded at weekly intervals. This vacation will last over several weeks (the precise number of weeks while making the program is unknown to the coder). Ask the user to enter the number of miles driven afterward ask them how many gallons of gasoline they purchased for each week of the vacation. If the user enters -99 when asked for the number of miles driven, the vacation is over and the program will end by printing "Vacation Over!".   Express all numeric values rounded to the nearest hundredth.  

The task is to create this in Java using only while loops.

Thank you.

In: Computer Science

Given the below code, compute the values of the best case, worst case and average case...

Given the below code, compute the values of the best case, worst case and average case knowing that the basic operation in the first loop takes 4 ns to execute and the basic operation in the second loop takes 5 ns to execute.

int A[20];

for (int i=0; i < 20; i++)

{

          cin >> A[i];

}

for (i=0; i < 20; i++)

{

          if (A[i] % 3 == 0)

                    break;

}

In: Computer Science

Writing a paper on Cyber bullying and having a little trouble in a few areas. I...

Writing a paper on Cyber bullying and having a little trouble in a few areas. I am not asking for answers or for anyone to complete the assignment. Just give me an example of how to tackle/ think of the question. The is a history question also but I do not need help with that part as history is rather straight forward. Below you will find the 3 questions and my thoughts. Just asking for your thoughts.

What is the connection of your issue or event to the lens of the humanities? I understand the humanities are art, music, books and etc...but I am having trouble I guess wording my questions right.

What is the connection of your issue or event to the lens of the natural and applied sciences for determining its impact on various institutions? This section I am looking at cyber bullying scientifically. Looking at who and how many people. Looking at scientific causes. So unless you think I am approaching it wrong. I do not need advice.

What is the connection of your issue or event to the lens of the social sciences for determining its impact on various institutions? For this section I am think I will look at the impact cyber bullying has had to teens. I will discuss depression, suicide and drug abuse rates.

In: Computer Science

A company uses AD and RADIUS To authenticate VPN in Wi-Fi connections. The Chief Information Security...

A company uses AD and RADIUS To authenticate VPN in Wi-Fi connections. The Chief Information Security Officer initiates a protect to extend a third-party MFA solution to VPN. During the pilot phase, VPN users successfully get an MFA challenge; however, they also get the challenge when connecting to Wi-Fi, which is not desirable. Which of the following best explains why you just are getting the MFA challenge in using Wi-Fi?

  1. In the radius server, the proxy rule has not specified the NSA Port type attribute that should be matched

  2. in the firewall, the AAA configuration, the IP address of the third-party MFA solution needs to be set as secondary radius server

  3. in the third-party MFA solution, authentication properties need to be configured to recognize Wi-Fi authentication request

  4. any Wi-Fi configuration, authentication needs to be changed to WPA2 Enterprise using EAP TLS to support the configuration

In: Computer Science

#include <stdio.h> #include <stdlib.h> // The below function Merges two subarrays of arr[]. // First subarray...

#include <stdio.h>
#include <stdlib.h>
// The below function Merges two subarrays of arr[].
// First subarray is arr[low..mid]--left to middle
// Second subarray is arr[mid+1..high]--middle+1 element to right most element
void merge(int arr[], int low, int mid, int high)
{
int i, j, k;
int len1 = mid - low + 1;
int len2 = high - mid;

//create two temporary arrays
int A[len1], B[len2];

/* Copy data to temporary arrays A[] and B[] */
for (i = 0; i < len1; i++)
A[i] = arr[low + i]; //Copies first half of array
for (j = 0; j < len2; j++)
B[j] = arr[mid + 1 + j]; //Copies second half of array

/* Merge the temporary arrays again into arr[low..high]*/
i = 0; // Initial index of first subarray
j = 0; // Initial index of second subarray
k = low; // Initial index of merged subarray
while (i < len1 && j < len2) {
if (A[i] <= B[j]) {
arr[k] = A[i];
i++;
}
else {
arr[k] = B[j];
j++;
}
k++;
}

/* The remaining elements of A[] should be copied, if there
are any */
while (i < len1) {
arr[k] = A[i];
i++;
k++;
}

/* The remaining elements of B[] should be copied, if there
are any */
while (j < len2) {
arr[k] = B[j];
j++;
k++;
}
}

/* low is for left most index and high is right index of the
sub-array of arr to be sorted */
void mergeSort(int arr[], int low, int high)
{
if (low < high) {
// checks if the left index is less than right index and avoids overflow for
int mid = low + (high - low) / 2;

// Sort first half from low to mid
mergeSort(arr, low, mid);
//Sort second half from mid+1 to high
mergeSort(arr, mid + 1, high);

merge(arr, low, mid, high); //Call merge function
}
}


/* Function to print the array */
void print(int arr[], int n)
{
int i;
for (i = 0; i < n; i++)
printf("%d ", arr[i]);
printf("\n");
}

/* main program to call the mergesort functions and read inputs*/
int main()
{
int n; printf("enter number of elements");
scanf_s("%d", &n);
int arr[n];
if (n <= 50 && n >= 0)// condition to check if input less than 50
{
for (int i = 0; i < n; i++)
scanf("%d", &arr[i]);
printf("Given array is \n");
print(arr, n);
mergeSort(arr, 0, n - 1);

printf("\nSorted array is \n");
print(arr, n);
return 0;
}
else
printf("invalid count entered");//since count should be between 0 and 50
}

why it has an error

I wrote c program in visual studio. but it has error   int A[len1], B[len2];

and

In: Computer Science

Write the following queries using the schema below Class (Number, Department, Term, Title) Student (Username, FirstName,...

Write the following queries using the schema below

Class (Number, Department, Term, Title)

Student (Username, FirstName, LastName, Year)

Takes (Username, Department, Number, Term, Grade)

[clarification] In Student, Year is an integer. A student can be a 2nd year student. In that case, Year value would be 2.

For the Takes relation:

·         Grade is NA for current semester students

·         Username is foreign key to Student

·         (Department, Number, Term) is foreign key to Class

a)       Write an SQL query that returns the Term when students with username “alex” and “bob” take at least 1 class together. Include the number of class that they have taken together in that Term.

b)      Write an SQL query that returns the usernames of the students who take exactly two classes in the “CSE” department in the term “Fall.2020”

c)       Write an SQL query that returns the title of all classes which have not been taken by any first-year student.

In: Computer Science

1) type a complete, working, C++ program that accepts two integer values from the variable num3,...

1) type a complete, working, C++ program that accepts two integer values from the variable num3, and store num1 raised to the power num2 into the variable num4. Then output the values of the four variables each on a separate line, formatted and with an appropriate message for each.keyboard into the variables num1 and num2, include prompts, store the square root of their sum into the

program :

In: Computer Science

Do we can find any example of SDLC being used for building houses? When did the...

  1. Do we can find any example of SDLC being used for building houses?
  2. When did the Chrome Password get rolled out? Is this being looked at as positive service by users?

In: Computer Science

What is the purpose of having a developmet plan for your business?

What is the purpose of having a developmet plan for your business?

In: Computer Science