Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

java program to check whether a number is prime or not using 'regex '
Exercise 8.4 from your textbook. Each of the following Python functions is supposed to check whether its argument has any lowercase letters.

For each function, describe what it actually does when called with a string argument. If it does not correctly check for lowercase letters, give an example argument that produces incorrect results, and describe why the result is incorrect.

# 1

def any_lowercase1(s):
for c in s:
if c.islower():
return True
else:
return False


# 2

def any_lowercase2(s):
for c in s:
if 'c'.islower():
return 'True'
else:
return 'False


# 5

def any_lowercase5(s):
for c in s:
if not c.islower():
return False
return True
Exercise 8.4 from your textbook. Each of the following Python functions is supposed to check whether its argument has any lowercase letters.

For each function, describe what it actually does when called with a string argument. If it does not correctly check for lowercase letters, give an example argument that produces incorrect results, and describe why the result is incorrect.

# 1

def any_lowercase1(s):
for c in s:
if c.islower():
return True
else:
return False


# 2

def any_lowercase2(s):
for c in s:
if 'c'.islower():
return 'True'
else:
return 'False'


# 3

def any_lowercase3(s):
for c in s:
flag = c.islower()
return flag


# 4

def any_lowercase4(s):
flag = False
for c in s:
flag = flag or c.islower()
return flag
Complete the class RunStudents. The outline of the class is as follows: public class RunStudents { public static void main(String[] args) { //add code for 1. //add code for 2. } } 1 Create an object of the type StudentLoans.. 2 Call the menuControl() in the StudentsLoan class by using the object defined in 1.
Code a method displayAllStudents(). This method has no parameters and is void. This method displays all the objects in the array. a) Display a heading . b) Loop through the array and use the show() of every object to display the object details. c) Print a line after each object is displayed. Example of expected output: Displaying all students -------------------- Student details Name: Smittie Student number: 12345 Loan amount: 10000.0 ------------------------- Student details Name: Jannie Student number: 67543
Code a method named createStudent(). This method has no parameters, but returns a Student object. a) Define a Scanner variable to read from the keyboard. b) Define variables for name, student number and loan amount. Prompt the user to type data values for each of the variables and then read the values from the keyboard. c) Define and create a Student object from the data read from the keyboard. d) Return this Student object. 4 Code a method named createPostGraduate(). This method has no parameters, but returns a PostGraduate object. a. Define a Scanner variable to read from the keyboard. b. Define variables for name, student number and loan amount and thesis. Prompt the user to type data values for each of the variables and then read the values from the keyboard. c. Define and create a PostGraduate object from the data read from the keyboard. d. Return this PostGraduate object.
StudentLoans class This class has a menu control method that allow users to add a Student or PostGraduate object to an array. The array allows for 20 elements, but the array may contain less elements. The number of elements if the arrays is available in the variable noOfStudents. 1 Code a no-argument constructor. In this constructor, a) Add 2 Student objects to the Students array. b) Add 2 PostGraduate objects to the Students array. c) Set noOfStudents to 4. 2 Code a method menu() that returns an int value. This value represents the choice the user has made from the available menu options. a) Define a Scanner variable to read from the keyboard. b) Define an int value, named choice. c) Display a menu in the following forma
POSTGRADUATE CLASS Write the PostGraduate class as per the class diagram. Remember to call the super class methods or constructors as needed. show() method This method is void and displays the details of a PostGraduate object as follows: Student details Name: Mpho Student number: 201812345 Loan amount: 10000.0 Thesis: I do not know Code the method interest(). This method returns a double value calculated as follows: loanAmount times 10%.
STUDENT CLASS Write the Student class as per show () method This method is void and d diagram. oes not students with student loans have any parameters. This method display s the details of a . Student object as follows: Student details Name: Smittie Student number: 12345 Loan amount: 10000.0 Coding for interest() method public double interest() { return loanAmount*.05; }
You Y are required to assist with ou must write all the development of a system to manage the JAVA classes. UML class diagram of two base classes STUDENT CLASS Write the Student class as per show () method This method is void and d diagram. oes not students with student loans have any parameters. This method display s the details of a . Student object as follows: Student details Name: Smittie 1 Applications Development Foundations I
LATEST TUTORIALS
APPROVED BY CLIENTS