Questions
Write a code in Python jupytoer note book: Ask the user to input a year. Check...

Write a code in Python jupytoer note book:

  1. Ask the user to input a year. Check if this is a leap year or not.

  • Ask the user to input a number. Check if this number is even or odd.

  • HbA1c of 6.5% or higher indicates diabetes. 5.7 to 6.4 indicates pre-diabetes. HbA1c less than 5.7 is considered normal. Ask the user for their HbA1c level and display if their they are in the normal range, pre-diabetic, or diabetic.

  • Ask the user to input a character and check if it is a vowel.

  • Ask the user for three numbers and find the highest of the three numbers.

  • In assignment 4.1 you completed, check if Joe made a profit or incurred a loss.

In: Computer Science

Problem1. James goes to restaurant for dinner. The items he orders are soup for $3.99, sandwich...

Problem1. James goes to restaurant for dinner. The items he orders are soup for $3.99, sandwich for $5.99 and a drink for $2.99, peach cobbler for $4.99. Calculate the subtotal, gratuity and total if the gratuity rate is 20%.

Problem2. Write a program which reads in an integer from the user and then prints out the last digit of the number that is 4 times the value which the user entered.

For example, if a user enters the number 52 , your program will compute the number 4*52=208 and print out the last digit which is 8.

Note: Use the modulo operator (%)

Problem3. Compute the volume of cylinder if the radius of the cylinder is 9 and length is 16. Assume the value of “pi” as 3.1415. Use the formula given below.

area = radius *radius*pi

volume = area *length

In: Computer Science

How are access control policies different between industries?

How are access control policies different between industries?

In: Computer Science

Why are random numbers generated with linear congruential methods not truly random? Describe the properties of...

Why are random numbers generated with linear congruential methods not truly random? Describe
the properties of the sequence of numbers these types of methods will produce.

In: Computer Science

Question 1: Defense organization of a country did a recent study, and the research recommends new...

Question 1:

Defense organization of a country did a recent study, and the research recommends new capability the country should build to keep the country protected from potential conflicts in the region. So there's a study and the solution, the system that they came up with require to be build has never been attempted, and no literature exist for such system. So it's a very fairly new area, or fairly new adventure or things that they need to create. And it's fairly big and complex system, and potentially can take decades to build. A lot of loss of time, a lot of years to build this software. And scientists have vague idea about how to go about it, but no concrete plan exists. And there'll be a lot of organization stakeholders because this of course defense organization of the country and a lot of stakeholders involved. So a lot of constraints will also be there that will impact on this initiative. So there's a lot of risk, a lot of constraints. So let's try to analyze this situation and see which model will work in this situation.

Model name :

Reason:

In: Computer Science

PHP programming language Circle Area, Circumference and ratio:  For a circle with a given radius, write a...

PHP programming language Circle Area, Circumference and ratio:  For a circle with a given radius, write a program to compute 1) area of the circle, 2) circumference of the circle and 3) the ratio of the circumference to its diameter.  You will use 3 different values of radius a) 10cm, b) 50 cm, and c) 100cm for your computations. The output should print or echo the following statements identifying the writer of the program and the computation for each value of the radius. Example: "This program was created by $Yourname. The area of the circle with radius 10cm is 314 square centimeters. Its circumference is 62.8cm and the ratio of its circumference to its diameter is 3.14" .  You will use variables to store the values of for each radius and for your computations along with your name.  Save the php file with yourlastnameCircle.php and also add your name in the comments section of the program. Following are the formulas needed for computation:

In: Computer Science

You have been hired as a programmer by a major bank. Your first project is a...

You have been hired as a programmer by a major bank. Your first project is a small banking transaction system. Each account consists of a number and a balance. The user of the program (the teller) can create a new account, as well as perform deposits, withdrawals, balance inquiries, close accounts, etc..

Initially, the account information of existing customers is to be read into an array of BankAccount objects. The private data members of the BankAccount Class will include: first name, last name, social security number, account number, account type (Checking, Savings, or CD), and account balance. The bank can handle up to MAX_NUM accounts. Use the following function to read in the data values:

public static int readAccts(BankAccount[] account, int maxAccts);

This method fills up the array (up to maxAccts) and returns the actual number of accounts read in (referred to as numAccts).

After initialization, print the initial database of accounts. Use method printAccts() described below.

The program then allows the user to select from the following menu of transactions:

Select one of the following: W - Withdrawal D - Deposit N - New account B - Balance I - Account Info X - Delete Account Q - Quit

Use the following method to produce the menu: public static void menu()

This method only displays the menu. The main program then prompts the user for a selection. You should verify that the user has typed in a valid selection (otherwise print out an error message and repeat the prompt).
Once the user has entered a selection, one of the following methods should be called to perform the specific transaction. At the end, before the user quits, the program prints the contents of the database.

public static int findAcct(BankAccount[] account, int numAccts, int reqAccount);

This method returns the index of reqAccount in the BankAccount array if the account exists, and -1 if it doesn't. It is called by all the remaining methods.

public static void withdrawal(BankAccount[] account, int num_accts);

This method prompts the user for the account number. If the account does not exist, it prints an error message. Otherwise, it asks the user for the amount of the withdrawal. If the account does not contain sufficient funds, it prints an error message and does not perform the transaction.

public static void deposit(BankAccount[] account, int num_accts);

This method prompts the user for the account number. If the account does not exist, it prints an error message. Otherwise, it asks the user for the amount of the deposit.

public static int newAcct(BankAccount[] account, int num_accts); This method prompts the user for a new account number. If the account already exists, it prints an error message. Otherwise, it adds the account to the database. The method then prompts the user to enter the new depositor’s first name, last name, social security number, the account type (Checking, Savings, or CD), and the initial opening deposit.. The method returns the new number of accounts in the database.

public static int deleteAcct(BankAccount[] account, int num_accts); This method prompts the user for an account number. If the account does not exist, or if the account exists but has a non-zero balance, it prints an error message. Otherwise, it closes and deletes the account. It returns the new number of accounts.

public static void balance(BankAccount[] account, int num_accts); This method prompts the user for an account number. If the account does not exist, it prints an error message. Otherwise, it prints the account balance.

public static void accountInfo(BankAccount[] account, int num_accts); This method prompts the user for a social security number (SSN). If no account exists for this SSN, it prints an error message. Otherwise, it prints the complete account information for all of the accounts with this SSN.

public static void printAccts(BankAccount[] account, int num_accts); This method prints a table of the complete account information for every active account.

Make sure that there is at least one depositor that has multiple accounts at the bank.

#1: Use nested classes: 1. A BankAccount consists of a Depositor, an account number, an account type, and a balance. 2. A Depositor has a Name and a social security number. 3. A Name consists of first and last names.

#2: Use a constructor to initialize the data members of a new account (including the initial accounts of the database). Hint: a constructor is a method that can be called.

Notes: 1. All output must be file directed 2. Only output must go to the file - not interactive prompts and menus. 3. No global variables are allowed 4. The program and all methods must be properly commented. 5. All data members of classes are to be private 6. Add accessor (getter) methods and mutator (setter) methods to all classes as appropriate 7. All I/O should be done outside of the BankAccount class implementation. 8. All I/O should be done within the methods of the class that contains the main() method.

Sample input:

Doe John M brown 34 lawyer 96345.87
Gold Jane F blonde 43 doctor 123456.78
Dillon Tom M black 34 teacher 87654.32

using java language pls

In: Computer Science

Write a recursive a Java code that checks if a number is Palindrome. A palindrome number...

Write a recursive a Java code that checks if a number is Palindrome. A
palindrome number is a number that reads the same from beginning to end and
from end to beginning, in other words, a palindrome number remains the same
when its digits are reversed. For example, 13431 is a palindrome number. 2332
is another one. (Note: Your algorithm should define and work with an integer
number)
The functionality of your code should be commented to explain what you do in
each part of the code.
You need to run your code for the following test cases and show the result:
1) 0          (output: yes)
2) 1234554321     (output: yes)
3) 123454321    (output: yes)
4) 1221       (output: yes)
5)   1234       (output: no)
6) 7676       (output: no)
7) -121      (output: yes)
8) -456      (output: no)
What is the time complexity of your algorithm? Cleary justify your
answer.

In: Computer Science

Ask the user for their name Create a file called "daily.dat" within the home directory Ask...

  1. Ask the user for their name
  2. Create a file called "daily.dat" within the home directory
  3. Ask the user for a line of text that the system should save to the file
  4. Add to the file the line of text entered by the user
  5. Ask the user for a second line of text that the system should save to the file
  6. Append at the end of the file the line of text entered by the user
  7. Create a copy of the file in the directory "backups" within the home directory, renaming the file daily.bu.
  1. Ask the user for their name
  2. Create a file called "daily.dat" within the home directory
  3. Ask the user for a line of text that the system should save to the file
  4. Add to the file the line of text entered by the user
  5. Ask the user for a second line of text that the system should save to the file
  6. Append at the end of the file the line of text entered by the user
  7. Create a copy of the file in the directory "backups" within the home directory, renaming the file daily.bu.


Please show screenshots from the command prompt! Thank you!

In: Computer Science

Script 3: Ask the user for a file's name If the file exists, ask them if...

Script 3:

  1. Ask the user for a file's name
  2. If the file exists, ask them if they would like to (C)opy, (M)ove, or (D)elete it by choosing C, M, or D
  3. If the user chooses C, ask for the destination directory and move it there
  4. If the user chooses M, ask for the destination directory and move it there
  5. If the user chooses D, delete the file.
  6. Ensure that the user enters only C, M, or D, warning them about the mistake if they should enter something else.

Please show screenshots from the command prompt! Thank you!

In: Computer Science

Java Problem: Array lists and linked lists are both implementations of lists. Give an example of...

Java Problem:

Array lists and linked lists are both implementations of lists. Give an example of a situation where an array list would be the better choice and one where a linked list would. Explain the reasons in each case. Provide example.

In: Computer Science

I am currently working on this problem. It says it is wrong, and I was wondering...

I am currently working on this problem. It says it is wrong, and I was wondering if someone could correct my code to where its ouput is as followed.

Expected Output:

6↵
5↵
4↵
3↵
2↵
1

Actual Output:

9↵
8↵
7↵
6↵
5↵
4↵
3↵
2↵
1↵
0↵

9.10: Reverse Array
Write a function that accepts an int array and the array’s size as arguments. The function should create a copy of the array, except that the element values should be reversed in the copy. The function should return a pointer to the new array. Demonstrate the function by using it in a main program that reads an integer N (that is not more than 50) from standard input and then reads N  integers from a file named data into an array. The program then passes the array to the your reverse array function, and prints the values of the new reversed array on standard output, one value per line. You may assume that the file data has at least N  values.

Prompts And Output Labels. There are no prompts for the integer and no labels for the reversed array that is printed out.

Input Validation. If the integer read in from standard input exceeds 50 or is less than 0 the program terminates silently.

I used this code:

#include<iostream>
#include<fstream>
using namespace std;

int *reverse(const int *, int);

int main()
{
int N;
N=10;
/*
cin >> N;
if(N > 50 || N < 0)
exit(0);
*/
// int *arr1 = new int[N], index;
int *arr1=new int[N];
int index;
for(int i=0;i<N;i++)arr1[i]=i;
/*
fstream datafile;
datafile.open("data.txt", ios::in | ios::out);

for(index = 0; index < N; index++)
{
datafile >> arr1[index];
}
*/
int *temp;

temp = reverse(arr1,N);

for(index = 0; index < N; index++)cout << temp[index] << endl;
system("PAUSE");
}

int *reverse(const int *arr1, int N)
{
int index = N-1;
int *arr2;
arr2 = new int[N];
for(int count = 0; count < N; count++)
{
arr2[count] = arr1[index];
index--;
}
return arr2;

}

In: Computer Science

1) Describe what is PCI DSS and what are the specific requirements for Applications?

1) Describe what is PCI DSS and what are the specific requirements for Applications?

In: Computer Science

C# Arrays & methods I'm having trouble implementing the GetIntArrayFromUser method in the following problem: Create...

C# Arrays & methods

I'm having trouble implementing the GetIntArrayFromUser method in the following problem:

Create a method AverageIntArray that takes an array of integers and calculates and returns the average of all values in the array as a double Write a program that uses GetIntArrayFromUser method to get an array of 7 numbers, then calls the AverageIntArray method to get the average then prints all values in the array that are greater than the average.
                Sample run:
                                Enter next whole number: 3
                                Enter next whole number: 8
                                Enter next whole number: 4
                                Enter next whole number: 12    
                                Enter next whole number: 13
                                Enter next whole number: 6
                                Enter next whole number: 9
                                Average: 7.85714285714286
                                8
                                12
                                13
                                9

here is GetIntArrayFromUser:

public void GetIntArrayFromUser()
{
Console.WriteLine("Enter number of list items");
int size = Convert.ToInt32(Console.ReadLine());
int[] arr = new int[size];
for (int i = 0; i < size; i++)
{
Console.WriteLine("Enter next whole number");
arr[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine("Items in the list: ");
foreach (int item in arr)
{
Console.WriteLine(item);
}
}

In: Computer Science

SQL Assignment Discuss why and when cursors could be used.

SQL Assignment

Discuss why and when cursors could be used.

In: Computer Science