How do I get my program to ask the user to re enter the correct information if the information entered does not match the database records? When I run my program it does let me know that the information entered does not match the database records but it does not ask me to enter the information again.
Please add code (in bold) in the proper area with short explanation
package MailMeSQL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
import com.mysql.cj.jdbc.JdbcConnection;
public class mailmeMain {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Please Enter your Email:");
String email = scanner.nextLine(); //get email from user
System.out.println("Please Enter your pin:");
int pin = scanner.nextInt(); //get pin from user
printUserData(email, pin); // call printUserData method with email and pin
}
private static void printUserData(String email, int pin) {
String url = "jdbc:mysql://localhost:3306/mailme";
String username = "root";
String password = "Chicago#71519";
Connection connection = null;
PreparedStatement preparedStatement = null;
ResultSet result = null;
try {
connection = DriverManager.getConnection(url, username, password);
String query = "select * from tenant_profile where email=? and pin=?";
preparedStatement = connection.prepareStatement(query); // prepare the sql query
preparedStatement.setString(1, email); // bind email value
preparedStatement.setInt(2, pin); //bind pin value
result = preparedStatement.executeQuery(); //execute query
while (result.next()) { //fetch result
System.out.println("Email=" + result.getString("email") + ",pin=" + result.getString("pin")
+ ",Package=" + result.getString("packages"));
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (result != null)
try {
connection.close();
result.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
In: Computer Science
ACCOUNTING INFORMATION SYSTEMS
Please answer your answer thoroughly. Thank you in advance!
Problem
11.8 As an internal auditor for the state auditor’s office, you are assigned to review the implementation of a new computer system in the state welfare agency. The agency is installing an online computer system to maintain the state’s database of welfare recipients. Under the old system, applicants for welfare assistance completed a form giving their name, address, and other personal data, plus details about their income, assets, dependents, and other data needed to establish eligibility. The data are checked by welfare examiners to verify their authenticity, certify the applicant’s eligibility for assistance, and determine the form and amount of aid.
Under the new system, welfare applicants enter data on the agency’s Web site or give their data to clerks, who enter it using online terminals. Each applicant record has a “pending” status until a welfare examiner can verify the authenticity of the data used to determine eligibility. When the verification is completed, the examiner changes the status code to “approved,” and the system calculates the aid amount.
Periodically, recipient circumstances (income, assets, dependents, etc.) change, and the database is updated. Examiners enter these changes as soon as their accuracy is verified, and the system recalculates the recipient’s new welfare benefit. At the end of each month, payments are electronically deposited in the recipient’s bank accounts.
Welfare assistance amounts to several hundred million dollars annually. You are concerned about the possibilities of fraud and abuse.
a. Describe how to employ concurrent audit techniques to reduce the risks of fraud and abuse.
b. Describe how to use computer audit software to review the work welfare examiners do to verify applicant eligibility data. Assume that the state auditor’s office has access to other state and local government agency databases.
In: Accounting
Write a python program for the following question.
Complete the symptom similarity function, which measures the similarity between the symptoms of two patients. See below for an explanation of how the similarity is computed.
def symptom_similarity(symptoms_A: Tuple[Set], symptoms_B: Tuple[Set]) -> int:
'''Returns the similarity between symptoms_A and
symptoms_B.
symptoms_A and symptoms_B are tuples of a set of symptoms present
and a set of symptoms absent.
The similarity measure is computed by the following
equations:
present_present + absent_absent - present_absent -
absent_present
where:
present_present is the number of symptoms present in both patients
absent_absent is the number of symptoms absent in both patients
present_absent is the number of symptoms present in patientA and absent in patientB
absent_present is the number of symptoms absent in
patientA and present in patientB.
>>>symptom_similarity(yang, maria)
1
#yang = ({"coughing", "runny_nose",
"sneezing"},{"headache","fever"})
#maria = ({"coughing", "fever", "sore_throat",
"sneezing"},{"muscle_pain"}
# As you can see the common part in these two tuple is "coughing'
so similarity is 1.
''''
Question 2: similarity to patients (18
points)
Complete the similarity to patients function, which uses the
function symptom similarity to select
the patients (from the entire population of patients in our
database) with the highest similarity between
the their symptoms and the symptoms of one patient. See below for
an explanation of exactly what is
expected:
def similarity_to_patients(my_symptoms : Tuple[Set],
all_patients: Dict[str, Tuple[Set]]) ->
Set[int]:
"""
returns a set of the patient IDs with the highest similarity
between my_symptoms
(which is a tuple of symptoms present and absent) and the symptoms
of
all the patients stored in the dictionary all_patients.
>>> similarity_to_patients(yang,
all_patients_symptoms)
{45437, 73454}
#PATIENTS ARE ASSIGNED ID and those ID stores their
symptoms. So we need to compare "yang's" symptoms to other patients
symptoms in the database.
"""
I will drop a like for even attempting to give a fruitful
solution.
In: Computer Science
Background:
When Ava started her Business Accounting firm 2 years ago, with 10 employees. This company of hers offers both accounting and bookkeeping services to businesses and is busy between December and April (5 months). Today, her company has 80 employees, supported by a team of 3 Information Technology staff. Her company has a local area network, capable of supporting 100 users/employees. In order to maintain data integrity and security, all data records are accessed via a database server running on the company’s local area network. The database server, of course, enables real-time access to data records. (Hence, no data records are stored on the employee’s computer.)
In the last 2 months, her company lost several bids on potential business projects due to the lack of IT resources, specifically the lack of storage capacity. Ava has decided to adopt the necessary the cloud computing service in order to resolve this issue. In other words, she has decided to shifte from assess-based physical IT resources to service-based virtual resources.
Your task:
1. Research and study to understand the key business operations of Accounting and the key business operations of Bookkeeping. 2. Create a screening rubric (in MS Word or MS Excel) to be used to evaluate/select the cloud service provider for resolving the abovementioned issue for Ava’s Business Accounting firm.
Hints: You need to determine the cloud service that may resolve the issue before you can create the screening rubric. Due to data sensitivity (integrity and security), Ava’s business can only use the private cloud model. Using the rubric created by you, can you select a cloud service provider that can meet Ava’s business requirements?
In: Finance
Motor, Inc. is a car dealer that sells both new cars and second-hand cars. You are the technical consultant of Motor Inc. and are currently helping the company to develop a database system. Your job is to draw an ERD to help them design the database.
In: Computer Science
For this assignment, pretend you have been hired by a school district to create an application enabling access to educational videos freely available on the Internet.
For examples of places where these videos are available, check out this page:
https://www.refseek.com/directory/educational_videos.html (Links to an external site.).
For this assignment, you are responsible for developing a database schema (both conceptual and physical) to support this application. The schema must support the following application features:
The submission for this assignment should include the following artifacts:
This assignment can be completed adequately using as few as four tables. Your schema may end up with more tables and that is fine, but if you end up with more than 7-8 tables there is a good chance you are overthinking things.
In: Computer Science
I am tasked with creating a Java application that used 2 synchronized threads to calculate monthly interest and update the account balance
This is the parameters for reference to the code. Create a class
AccountSavings. The class has two instance variables: a double
variable to keep annual interest rate and a double variable to keep
savings balance. The annual interest rate is 5.3 and savings
balance is $100.
• Create a method to calculate monthly interest. • Create a method
to run two threads. Use anonymous classes to create these threads.
The first thread calls the monthly interest calculation method 12
times, and then displays the savings balance (the balance in 12th
month). After that, this thread sleeps 5 seconds. The second thread
calls the monthly interest calculation method 12 times, and then
displays the savings balance (the balance in 12th month). Before
the main thread ends, these two threads must be completed. • Add
your main method into the same class and test your threads. After
these two threads are executed, the savings balance must remain
same
I am getting an error when calling monthlyInterest method inside my runThread method. non-static method monthlyInterest() cannot be referenced from a static context and I cant seem to figure out how to fix the issue.
import static java.lang.Thread.sleep;
class AccountSavings {
double annualInterest=5.3;
double savings=100.00;
public void monthlyInterest(){
double monthlyRate;
monthlyRate = annualInterest/12;
double balance = 0;
balance+=savings*monthlyRate;
}
public synchronized static void
runThread(){
Thread t1;
t1 = new Thread(){
AccountSavings accountSavings= new AccountSavings();
@Override
public void run(){
for(int i=1;i<13;i++){
System.out.println("Balance after " + i + "month: " +
monthlyInterest());
}
try{sleep(5000);}
catch(InterruptedException e){e.printStackTrace();}
}
};
Thread t2= new Thread(){
AccountSavings accountSavings=new
AccountSavings();
@Override
public void run(){
for(int
i=1;i<13;i++){
System.out.println("Balance after " + i + " month: " +
monthlyInterest(balance));
}
try{sleep(5000);}
catch(InterruptedException
e){e.printStackTrace();}
}
};
t1.start();
t2.start();
}
public static void main(String[] args){
runThread();
}
}
In: Computer Science
Part 1: Summarize the current state of the economy. o Do this using economic data and reports. Be sure to interpret the data you present. o Be sure to use economic theory and models to help explain what is going on at this moment.
Part 2: Discuss what you think the state of the economy will look like at the time of your last graduation (with your highest planned degree) and what that will mean for your job prospects and your income earning potential. o Do this by referring to published economic forecasts, or by making your own economic forecast. o Be sure to use economic theory and models to help explain why you think economic conditions will be as you predict. o Be sure to think about how your specific degree and profession will fit into the future labor market
Part 3: Discuss one major financial goal you wish to accomplish in the next 10 years, set up a simple financial plan to reach that goal, then discuss how the performance of the economy and economic policies could affect your ability to reach that goal. o Start by stating your personal financial goal and briefly summarizing your financial plan. Then discuss what assumptions you are making about the economy and your financesin your financial plan Then use economic theory and models to explain what events/changes could accelerate or derail the pursue of your goal o Think about the probability of a recession, probability of unemployment in your profession, average return on investments, potential wage growth, inflation, etc… in the next 10 years.
Paper Requirements: 4 pages (typed double spaced) Whenever you refer to a vocabulary term / concept / theory / principle from class you should bold and underline the text. o for example: "The economy isin a recessionwith the unemployment rate dramatically above the natural unemployment rate." 4 outside /verifiable references (APA or MLA style) with in-text citations and a full works cited section. o These references must be 4 different, outside sources from verifiable sources; no blogs, and no wikis. Your textbook does not count as one of your required citations.
In: Economics
In modern cosmology, it is commonly stated to the public that as we look deeper and deeper into space, we are seeing further into the past. CMB is the relic of the big bang after photon decoupling following recombination. However, if we pushed further back in our conceptualization, eventually we get to the period of inflation, and then to a period before that where energy density of the universe was some large value (possibly infinite).
So why would it be wrong to conceptualize the universe as being enclosed by an infinitely dense shell?
Update: For clarification, wikipedia has a good definition of observable universe, and answers in the affirmative on how every observer will see a different observable universe. This question is whether there are valid approaches in theories to avoid issues of big bang singularites.
Update2: I scaled back the question and accepted an answer, I think I was being overly vague in the write up and plan on asking the question again.
In: Physics
Would you put together a Cost of Goods Manufactured Statement for the following information?
On September 10 of the current year, all the inventory of Rawls Manufacturing was destroyed in a storm. We need help with the insurance claims on the company's losses. The following information was taken from a computer saved from the storm.
Inventories on August 31:
Materials inventory 20,000
Work in process inventory 4,000
Fininished goods inventory 14,000
Manufacturing activity from September 1 to 10:
Direct material requisitions 70,000
Direct materials purchased 66,000
Cost of goods sold 150,000
Prime costs used 80,000
Cost of goods manufactured 148,000
The overhead rate is 110% of direct materials costs.
Thank you!
Update:
All the quantities and rates are listed above. This is a problem given to our class by the instructor in a graduate level cost account ing class or course as a homework problem.
In: Accounting