Write a Java program that have ten integral values into an array namely List. Your program
should have a menu to select/perform the following functions :-
lnsert ( ) - accept a value into the array if it's not full
Remove ( ) - remove a value from an array if it's not empty based on user selection
Search ( ) - Return the numbers of the particular search value
lncrease ( ) - lncrease the percentage of the store value based onto the input percentage
Update ( ) - Edit the existing value choose by user.

Answers

Answer 1
Here is a Java program that includes a menu with the four functions you specified: Insert, Remove, Search, and Increase. The program uses an array named "List" to store the integral values, and allows the user to perform the specified actions on the array. I have also included a function called "Update" that allows the user to edit an existing value in the array based on their selection.

import java.util.Scanner;

public class ArrayMenu {
static Scanner input = new Scanner(System.in);
static int[] List = new int[10];
static int size = 0;

public static void main(String[] args) {
boolean exit = false;
while (!exit) {
System.out.println("Menu:");
System.out.println("1. Insert a value");
System.out.println("2. Remove a value");
System.out.println("3. Search for a value");
System.out.println("4. Increase the value of all elements by a percentage");
System.out.println("5. Update an existing value");
System.out.println("6. Exit");
System.out.print("Enter your choice: ");
int choice = input.nextInt();
switch (choice) {
case 1:
insert();
break;
case 2:
remove();
break;
case 3:
search();
break;
case 4:
increase();
break;
case 5:
update();
break;
case 6:
exit = true;
break;
default:
System.out.println("Invalid choice. Please try again.");
break;
}
}
}

public static void insert() {
if (size < 10) {
System.out.print("Enter a value to insert: ");
int value = input.nextInt();
List[size] = value;
size++;
} else {
System.out.println("Array is full. Cannot insert a new value.");
}
}

public static void remove() {
if (size > 0) {
System.out.print("Enter the index of the value to remove: ");
int index = input.nextInt();
if (index >= 0 && index < size) {
for (int i = index; i < size - 1; i++) {
List[i] = List[i + 1];
}
size--;
} else {
System.out.println("Invalid index. Please try again.");
}
} else {
System.out.println("Array is empty. Cannot remove a value.");
}
}

public static void search() {
System.out.print("Enter a value to search for: ");
int value = input.nextInt();
boolean found = false;
for (int i = 0; i < size; i++) {
if (List[i] == value) {
System.out.println("Value found at index " + i);
found = true;
}
}
if (!found) {
System.out.println("Value not found in the array.");
}

Related Questions

Describe your academic and career plans and any special interests (e.g., undergraduate research, academic interests, leadership opportunities, etc.) that you are eager to pursue as an undergraduate at Indiana University. If you encountered any unusual circumstances, challenges, or obstacles in completing your education, share those experiences and how you overcame them.

Answers

Answer:

My academic and career plans are to pursue an undergraduate degree in business and minor in accounting. I am particularly interested in the finance, marketing, and management fields. After graduating, I plan to go on to pursue a Master's degree in Business Administration.

I am eager to pursue leadership opportunities at Indiana University, and would like to become involved in the student government. I am also interested in participating in undergraduate research, and exploring the possibilities of internships or other professional development experiences. Finally, I am looking forward to getting involved in extracurricular activities, such as clubs and organizations, to gain a better understanding of the business field and to network with other students and professionals.

Throughout my educational journey, I have had to overcome a few obstacles that have been made more difficult due to the pandemic. I have had to adjust to a virtual learning environment and find new ways to stay engaged in my classes. Additionally, I have had to learn how to manage my time more efficiently, which has been challenging due to the fact that I am also working part-time. Despite these difficulties, I have been able to stay motivated by setting goals and prioritizing my work. With determination and perseverance, I am confident that I can achieve my academic and career goals.

Type the program's output states = ['CA', 'NY', 'TX', 'FL', 'MA'] for (position, state) in enumerate(states): print(state, position)

Answers

Answer:

states = ['CA', 'NY', 'TX', 'FL', 'MA']

for (position, state) in enumerate(states):

   print(state, position)

Output:

CA 0

NY 1

TX 2

FL 3

MA 4

If you have a PC, identify some situations in which you can take advantage of its multitasking capabilities.

Answers

Situation one: using multiple monitors for tutorials on one screen and an application on another

Situation two: using virtual desktops for separating school and personal applications

Which company gave Apple its big break in the business market?

Commodore Business Machines
Software Arts
Tandy Corporation
Microsoft

Answers

Answer:

Microsoft

Explanation: I’m not a computer fanatic, but everybody should know this. And if anything else is the answer, then that’s because it would’ve been in the text that I DON’T have.

Answer: software arts

Explanation:

i just did it

Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 percent.in python

Answers

Answer:

This program first prompts the user to enter the amount of the purchase. It then defines the state and county sales tax rates as constants. It calculates the state and county sales tax amounts by multiplying the purchase amount by the appropriate tax rate. Finally, it calculates the total sales tax by adding the state and county sales tax amounts together, and prints the results.

What benefit do internal networked e-mail systems provide over Internet-based systems?

A) They enable the transmission of videos.
B) They allow e-mail to be sent to coworkers.
C) They allow files to be shared by sending attachments.
D) They provide increased security.

Answers

Answer:

The correct answer is D) They provide increased security.

You are a member of Future Business Leaders of America, and a local retirement community has asked if you and
your other members could come to their facility to help teach the residents that live there how to use technology
so that they can communicate with their grandchildren. This is an example of
networking
a competition
community service
a class assignment

Answers

Senior executives typically invite network members to participate in the planning and implementation of the change process at the first meeting. There is a matter of minutes, and Meetings are scheduled frequently.

Which three strategies would you recommend to make your company a fantastic place to work?

Fantastic lines of communication between management and employees. a feeling of belonging within the crew. allowing workers the freedom to develop their skills. a tradition of ongoing development.

What are some tactics you may employ to promote innovation and creativity within a company?

Ask your staff to present their ideas if you want to encourage creativity and innovation. You might also develop a procedure to submit them. Request that each employee presents an idea within a set deadline, and offer incentives to encourage discussion.

to know more about community service here:

brainly.com/question/15862930

#SPJ1

The user is able to input grades

and their weights, and calculates the overall final mark. The program should also output what you need to achieve on a specific assessment to achieve a desired overall mark. The program should be able to account for multiple courses as well. Lists are allowed.

Name of person
Number of courses
Course ID
Grades and Weights in various categories (Homework, Quiz, and Tests)
Enter grades until -1 is entered for each category
Final Grade before exam
Calculate to get a desired mark (using final exam)
Output all courses

Answers

Answer:

Here is an example of how you could write a program to perform the tasks described:

# Store the student's name and number of courses

name = input("Enter the student's name: ")

num_courses = int(input("Enter the number of courses: "))

# Create an empty list to store the course data

courses = []

# Loop through each course

for i in range(num_courses):

   # Input the course ID and initialize the total grade to 0

   course_id = input("Enter the course ID: ")

   total_grade = 0

   

   # Input the grades and weights for each category

   print("Enter grades and weights for each category (enter -1 to finish)")

   while True:

       category = input("Enter the category (homework, quiz, test): ")

       if category == "-1":

           break

       grade = int(input("Enter the grade: "))

       weight = int(input("Enter the weight: "))

       

       # Calculate the contribution of this category to the total grade

       total_grade += grade * weight

       

   # Store the course data in a dictionary and add it to the list

   course_data = {

       "id": course_id,

       "grade": total_grade

   }

   courses.append(course_data)

   

# Input the final grade before the exam

final_grade_before_exam = int(input("Enter the final grade before the exam: "))

Code practice

Write a program that will ask a user how many numbers they would like to check. Then, using a for loop, prompt the user for a number, and output if that number is divisible by 3 or not. Continue doing this as many times as the user indicated. Once the loop ends, output how many numbers entered were divisible by 3 and how many were not divisible by 3.


Sample Run :


How many numbers do you need to check? 5

Enter number: 20

20 is not divisible by 3.

Enter number: 33

33 is divisible by 3.

Enter number: 4

4 is not divisible by 3.

Enter number: 60

60 is divisible by 3.

Enter number: 8

8 is not divisible by 3.

You entered 2 number(s) that are divisible by 3.

You entered 3 number(s) that are not divisible by 3.

Answers

Answer:

n = int(input("How many numbers would you like to check? "))

divisible_count = 0

not_divisible_count = 0

for i in range(n):

   num = int(input("Enter a number: "))

   if num % 3 == 0:

       print(str(num) + " is divisible by 3")

       divisible_count += 1

   else:

       print(str(num) + " is not divisible by 3")

       not_divisible_count += 1

print("You checked " + str(n) + " numbers.")

print("Of those, " + str(divisible_count) + " were divisible by 3.")

print("And " + str(not_divisible_count) + " were not divisible by 3.")

Explanation:

You would run the program, it will ask the user to enter a number of integers, to check after that it will ask to enter numbers one by one, for each input, it will check if it's divisible by 3 or not, and keep counting how many were divisible or not divisible. After the loop ends, the program will output a summary of the total numbers checked, how many of them were divisible by 3 and how many were not.

You may further adjust it to match the requirement you need

Hey tell me more about your service

Answers

Answer:

look below!

Explanation:

please add more context and I’ll be happy to answer!

Workstations are usually applied for scientific, mathematical, and engineering calculations and computer aided-design and computer aided- manufacturing. a. False b. True ​

Answers

Workstations are usually applied for scientific, mathematical, and engineering calculations and computer aided-design and computer aided- manufacturing is True

What is Workstations?

Workstations are specialized computers that are designed for high-performance and resource-intensive tasks such as scientific, mathematical, and engineering calculations, computer-aided design (CAD), and computer-aided manufacturing (CAM).

Therefore, They typically have faster processors, more memory, and better graphics capabilities than general-purpose computers, which allows them to handle the complex tasks required in these fields.

Learn more about Workstations from

https://brainly.com/question/9958445

#SPJ1

draw a flowchart to accept two numbers and check if the first number is divisible by the second number

Answers

Answer:



I've attached the picture below, hope that helps...

Assignment 3: Chatbot
What the code for assignment 3: chatbot Edhesive.

Answers

Coding is difficult but I don't have a chatbot

Answer:

import random

# Introduction

print("Welcome to the fashion chatbot! I'm here to help you with your fashion preferences.")

# Ask for user's first name

print("What is your first name?")

name = input()

# Ask for user's shoe preference

print("What shoes do you like?")

shoe_preference = input()

# Use if-elif-else statement to respond to user's shoe preference

if shoe_preference == "Converse":

 print("Nice, casual is always in!")

elif shoe_preference == "Boots":

 print("Cool, boots are a versatile choice.")

else:

 print("Great choice!")

# Ask for user's age

print("How old are you?")

age = input()

# Use if-elif-else statement to respond to user's age

if int(age) < 18:

 print("It's a great time to start exploring your style!")

elif int(age) < 25:

 print("You're at a fun age to experiment with your fashion choices.")

else:

 print("It's always a good time to try out new fashion styles!")

# Use a randomly generated number to randomly respond

random_number = random.randint(1, 3)

if random_number == 1:

 print("I think I might know your style.")

elif random_number == 2:

 print("You have a unique sense of style.")

else:

 print("You have great fashion taste.")

# Ask for user's favorite top

print("So, " + name + ", what is your favorite top?")

top_preference = input()

# Use if-elif-else statement to respond to user's top preference

if top_preference == "Graphic Tees":

 print("That's a good choice.")

elif top_preference == "Button-up shirts":

 print("Classy and sophisticated.")

else:

 print("Great choice!")

# Use a randomly generated number to randomly respond

random_number = random.randint(1, 3)

if random_number == 1:

 print("Ay that's lit.")

elif random_number == 2:

 print("wow, so stylish!")

else:

 print("That's in right now.")

# Ask for user's bottom preference

print("I like where this is going.")

print("What about your choice of bottom?")

bottom_preference = input()

# Use if-elif-else statement to respond to user's bottom preference

if bottom_preference == "Jeans":

 print("Jeans are a classic choice.")

elif bottom_preference == "Cargo pants":

 print("You can't go wrong with those.")

else:

 print("Great choice!")

# Ask for user's head accessory preference

print("What about your head accessory?")

head_accessory_preference = input()

# Use if-elif-else statement to respond to user's head accessory preference

if head_accessory_preference == "Beanies":

   print("Beanies are fun!")

elif head_accessory_preference == "Baseball hats":

   print("Baseball hats are a popular choice.")

else:

   print("Unique choice!")

# End conversation

print("Well, " + name + ", it was awesome getting to know your style.")

Start with a population of 500 organisms, a growth rate of 2, and a growth period to achieve this rate of 6 hours. Assuming that none of the organisms die, this would imply that this population would double in size every 6 hours. Thus, after allowing 6 hours for growth, we would have 1000 organisms, and after 12 hours, we would have 2000 organisms.


Write a program that takes these inputs and displays a prediction of the total population.


MY PROGRAM:

organisms=int(input("Enter the initial number of organisms:"))

growth=float(input("Enter the rate of growth [a real number > 1]:"))

numHours=int(input("Enter the number of hours to achieve the rate of growth:"))

totalHours=int(input("Enter the total hours of growth:"))

population = organisms

hours=1

while numHours < totalHours:

population *= growth

hours += numHours

if hours >= totalHours:

break

print(" The total population is ", population)

My program gives the correct answer for the original problems numbers, but when I run it through our test case checker it comes back as 3/4 correct.. the problem test case being [organisms 7, growth rate 7, growth period 7, total hours 7]... can't see where I'm going wrong...

Answers

Answer:

It looks like there are a few issues with your program.

First, the line hours += numHours should be hours += 1. This is because you want to increment the hours variable by 1 each time through the loop, not by the number of hours required to achieve the growth rate.

Second, you are only multiplying the population by the growth rate once per iteration of the loop, but you should be doing it every time hours is less than or equal to totalHours. You can fix this by moving the population *= growth line inside the loop's if statement, like this:

while numHours < totalHours:

   if hours <= totalHours:

       population *= growth

   hours += 1

   if hours >= totalHours:

       break

Finally, you are using the variable numHours in your while loop condition, but it should be hours. You should change while numHours < totalHours: to while hours < totalHours:.

With these changes, your program should work correctly for the test case you provided. Here is the modified version of your program:

organisms=int(input("Enter the initial number of organisms:"))

growth=float(input("Enter the rate of growth [a real number > 1]:"))

numHours=int(input("Enter the number of hours to achieve the rate of growth:"))

totalHours=int(input("Enter the total hours of growth:"))

population = organisms

he assessment you are doing lives in the cloud. The program that grades it and saves your score lives in the cloud. Who might need to apply
atches to this software? Select three options.
The school is responsible for updating computers in its computer lab if you work at school.
It depends on the operating system you are using. Some operating systems do not do updates.

Answers

Updates known as patches are made available by both hardware producers and software developers (of both operating systems and applications).

What do patches mean?

Operating system (OS) and software patches are updates that address security holes in a program or product. Updates may be released by software developers to fix performance problems and include better security features.

Why are software patches and updates necessary?

Updates can improve application functionality and compatibility while mitigating security holes. The continued operation of computers, mobile devices, and tablets depends on software upgrades. They might also lessen security flaws. Data breaches, hacking, and identity theft have all lately hit the news.

To know more about software visit:-

https://brainly.com/question/985406

#SPJ1

Code to be written in python:
Correct code will automatically be awarded the brainliest

You had learnt how to create the Pascal Triangle using recursion.

def pascal(row, col):
if col == 1 or col == row:
return 1
else:
return pascal(row - 1, col) + pascal(row - 1, col - 1)

But there is a limitation on the number of recursive calls. The reason is that the running time for recursive Pascal Triangle is exponential. If the input is huge, your computer won't be able to handle. But we know values in previous rows and columns can be cached and reused. Now with the knowledge of Dynamic Programming, write a function faster_pascal(row, col). The function should take in an integer row and an integer col, and return the value in (row, col).
Note: row and col starts from 1.

Test Cases:
faster_pascal(3, 2) 2
faster_pascal(4, 3) 3
faster_pascal(100, 45) 27651812046361280818524266832
faster_pascal(500, 3) 124251
faster_pascal(1, 1) 1

Answers

def faster_pascal(row, col):

 if (row == 0 or col == 0) or (row < col):

   return 0

 arr = [[0 for i in range(row+1)] for j in range(col+1)]

 arr[0][0] = 1

 for i in range(1, row+1):

   for j in range(1, col+1):

     if i == j or j == 0:

       arr[i][j] = 1

     else:

       arr[i][j] = arr[i-1][j] + arr[i-1][j-1]

 return arr[row][col]

Here is a solution using dynamic programming:

def faster_pascal(row, col):
# Create a list of lists to store the values
values = [[0 for i in range(row+1)] for j in range(row+1)]

# Set the values for the base cases
values[0][0] = 1
for i in range(1, row+1):
values[i][0] = 1
values[i][i] = 1

# Fill the rest of the values using dynamic programming
for i in range(2, row+1):
for j in range(1, i):
values[i][j] = values[i-1][j-1] + values[i-1][j]

# Return the value at the specified row and column
return values[row][col]


Here is how the algorithm works:

1-We create a list of lists called values to store the values of the Pascal Triangle.
2-We set the base cases for the first row and column, which are all 1s.
3-We use a nested loop to fill the rest of the values using dynamic programming.
We use the values in the previous row and column to calculate the current value.
4-Finally, we return the value at the specified row and column.

Write a java program that asks the student for his name and the month in which he/she was born. Students are then divided into sections, according to the following: Section A: Name starts between A - E Born between months 1 - 6 Section B: Name starts between F - L Born between months 1 - 6 Section C: Name starts between M - Q Born between months 7 - 12 Section D: Name starts between R - Z Born between months 7 - 12

Answers

Answer:

import java.util.Scanner;

public class SectionAssignment {

 public static void main(String[] args) {

   // Create a scanner object to read input

   Scanner input = new Scanner(System.in);

   

   // Prompt the student for their name

   System.out.print("Enter your name: ");

   String name = input.nextLine();

   

   // Prompt the student for the month they were born

   System.out.print("Enter the month you were born (1-12): ");

   int month = input.nextInt();

   

   // Assign the student to a section based on their name and birth month

   String section = "";

   if (name.charAt(0) >= 'A' && name.charAt(0) <= 'E' && month >= 1 && month <= 6) {

     section = "A";

   } else if (name.charAt(0) >= 'F' && name.charAt(0) <= 'L' && month >= 1 && month <= 6) {

     section = "B";

   } else if (name.charAt(0) >= 'M' && name.charAt(0) <= 'Q' && month >= 7 && month <= 12) {

     section = "C";

   } else if (name.charAt(0) >= 'R' && name.charAt(0) <= 'Z' && month >= 7 && month <= 12) {

     section = "D";

   } else {

     section = "Invalid";

   }

   

   // Print the student's section assignment

   System.out.println("Your section is: " + section);

 }

}

1. Explain the benefits and drawbacks of using C++ and Visual Studio in a coding project.
2. Explain the benefits and drawbacks of using Java and Eclipse or Python and PyCharm in a coding project.
3. Describe the advantages of being able to code in multiple coding languages and compilers.

Answers

Answer:

1. The benefits of using C++ and Visual Studio in a coding project include the availability of a wide range of libraries and tools, the ability to create high-performance applications, and the ability to customize the code as needed. Drawbacks include the complexity of the language and the potential for memory leaks.

2. The benefits of using Java and Eclipse or Python and PyCharm in a coding project include the availability of a large number of libraries and tools, the ability to create high-level applications quickly, and the relative simplicity of the language. Drawbacks include the potential for code to become bloated and the lack of support for certain features.

3. The advantages of being able to code in multiple coding languages and compilers include the ability to use different languages and tools for different tasks, the ability to switch between languages quickly, and the ability to take advantage of the strengths of each language. Additionally, coding in multiple languages can help to increase one's overall coding knowledge and skills.

Explanation:

Which computers were the first PCs with a GUI
MS-DOS
Linux
Windows
Mac

Answers

The earliest GUI-equipped PCs were Linux and Mac-based. These are the right answers to the question that was asked.

Which PCs had a graphical user interface (GUI) first?

The first computer to employ a mouse, the desktop metaphor, and a graphical user interface (GUI), concepts Douglas Engelbart first introduced while at International, was the Xerox Alto, developed at Xerox PARC in 1973. It was the first instance of what is now known as a full-fledged personal computer.

When was the GUI added to Windows?

Windows is based on what is known as a graphical user interface (GUI), which was created by Xerox in 1975 but was never used. The "window, icon, menu, and pointing device" (WIMP) combination will make up the majority of a typical GUI.

To learn more about GUI visit:

brainly.com/question/14758410

#SPJ1

In the acronym, MS-DOS, DOS stands for which option?

Digital Operating System
Disk Operating System
Dynamic Operating System
Distributed Operating System

Answers

Answer:

Disk Operating System

Explanation:

4.3 lesson practice phython

Answers

Answer:

user input loop

count variable

user input

Explanation:

these are you answers

My code doesn't give me the right output: I have to use the Python input command, and the number could be a decimal fraction, such as 6.5, so I should use floating point numbers?
I need to have a loop that repeats six times, with a routine in the middle of the loop to get the user input as a floating point number and add the number to a sum.

Can someone check it for me?
score_list = [ input("Judge No {} :score ".format(num+1)) for num in range(6)]
int_accumilator :int = 0
for score in score_list:
if(score > 10 ):
print("i only like numbers within the 0-10 range !")
exit()
int_accumilator+= score

print("the average score is ...", int_accumilator/ len(score_list))

Answers

Answer:

def get_score(judge_num: int) -> float:

   """

   Asks the user for the score of a single judge and returns it.

   """

   score = float(input(f"Score for Judge {judge_num}: "))

   return score

def calculate_average(scores: list[float]) -> float:

   """

   Calculates the average score given a list of scores.

   """

   return sum(scores) / len(scores)

# Initialize the total score to 0

total_score = 0

# Initialize an empty list to store the scores of the judges

scores = []

# Loop through each judge

for judge_num in range(1, 7):

   # Get the score for the current judge

   score = get_score(judge_num)

   # Add the score to the total score

   total_score += score

   # Append the score to the list of scores

   scores.append(score)

# Calculate the average score

average_score = calculate_average(scores)

# Print the average score

print(f"The average score is: {average_score:.2f}")

There are a few issues with your code.

First, the input function returns a string, not a number. You need to convert the input to a number using the float function before adding it to the int_accumulator.

Second, you have defined int_accumulator as an int, but you are trying to add floating point numbers to it. This will cause an error. Instead, you should define int_accumulator as a float to allow it to hold decimal values.

Finally, you have a typo in your code - int_accumilator should be int_accumulator.

Here is the corrected code:

score_list = [float(input("Judge No {} :score ".format(num+1))) for num in range(6)]
int_accumulator: float = 0
for score in score_list:
if score > 10:
print("I only like numbers within the 0-10 range !")
exit()
int_accumulator += score

print("the average score is ...", int_accumulator / len(score_list))

This should allow you to get the correct output.

To insert a new column to left of a specific column right click the header containing the columns letter and select

Answers

To insert a new column to the left of a specific column, right-click the header containing the column's letter and select simply right-click on any cell in a column, right-click and then click on Insert.

What is inserting columns?

By doing so, the Insert dialog box will open, allowing you to choose "Entire Column." By doing this, a column would be added to the left of the column where the cell was selected.

Go to Home > Insert > Insert Sheet Columns or Delete Sheet Columns after selecting any cell in the column. You might also right-click the column's top and choose Insert or Delete.

Therefore, to insert a column, right-click the header containing the column's letter.

To learn more about inserting columns, refer to the link:

https://brainly.com/question/5054742

#SPJ1

To protect your online privacy, you should not?
A. be careful when talking to strangers online.
B. use an antivirus software.
C. download updates for mobile devices and computers.
D. use the same password for every account.

Answers

Answer:

Your answer to this will be D) Use the same password for every account.

Explanation:

This is the only option you should not do. If someone gets access or hacks into one of your accounts, and all accounts to anything are the same password they will have all of your accounts.

This type of network may not be connected to other networks.


A) LAN
B) MAN
C) WAN

Answers

Answer:

LAN

Explanation:

brainliest?:(

Answer:

A) LAN (Local Area Network)

Write the Holiday Date of the following holidays:
1. Bonifacio Day –
2. Christmas Day –
3. Rizal Day –
4. Day of Valor –
5. Labor Day –
6. Independence Day –
7. New Year’s Day –
8. People Power Day –
9. Ninoy Aquino Day –
10. All Saint’s Day –

Answers

Answer:

1. November 30

2. December 25

3. December 30

4. April 9

5. September 1

6. (depends)

7. January 1

8. February 25

9. August 21

10. November 1

Explanation:

A table student consists of 5 rows and 7 columns. Later on 3 new attributes are added and 2 tuples are deleted. After some time 5 new students are added. What will be the degree and cardinality of the table?​

Answers

Answer:

The degree of a table refers to the number of attributes (columns) it has. In the case you described, after the 3 new attributes are added, the degree of the table would be 7 + 3 = 10.

The cardinality of a table refers to the number of rows (tuples) it has. In the case you described, after 2 tuples are deleted, the cardinality of the table would be 5 - 2 = 3. After 5 new students are added, the cardinality would increase to 3 + 5 = 8.

Code to be written in python:
Correct answer will get brainliest :)

Mr Wu has been going to work every day by taxi for many years. However, the taxi fare has been increasing rather quickly in recent years. Therefore, he is considering driving to work instead. One of the costs for driving is the parking fee. The parking rates of the car park at Mr Wu's workplace are as shown as below:

Weekdays:
$2 per hour between 4am and 7am
$1.20 per half hour between 7am and 6pm
$5 per entry after 6pm

Saturdays:
$2.50 per hour between 4am and 7am
$1.50 per half hour between 7am and 6pm
$7 per entry after 6pm

Sunday: Flat rate of $5 per entry

For all days, there is a grace period of 10 minutes.
The car park opens between 4am and 12 midnight daily. We assume vehicles are magically ejected at midnight.
There is a 10% surcharge on weekdays and a 20% surcharge on Saturdays for vehicles who park for more than 10 hours. There are no surcharges on Sunday.
There is an additional fee of $3 for exiting after 10pm on any day.
Your task is to write a function compute_fee(day, time_in, time_out) that computes the parking fee, where day is an integer between 1 and 7, with 7 representing Sunday, while time_in and time_out are integer values in a 24-hour format - e.g. 700 for 7am and 2359 for 11:59pm. Assume all input is valid.


Below are a few examples of how the fee is calculated:



Example 1: Tuesday, 4:29am to 7:50am.

• 4:29am to 7am is charged as 3 1-hour slots: $2.00 * 3 = $6.00

• 7am to 7:50am is charged as 2 30-minute slots: $1.20 * 2 = $2.40

• Total fee = $6.00 + $2.40 = $8.40



Example 2: Saturday, 7:01am to 7:49pm.

• 7:01am to 6pm is charged as 22 30-minute slots: $1.50 * 22 = $33.00

• 6pm to 7:49pm is charged as one entry: $7.00

• 20% Surcharge for parking more than 10 hours: ($33.00 + $7.00) * 20% = $8.00

• Total fee = $33.00 + $7.00 + $8.00 = $48.00


Example 3: Sunday, 3pm to 10:01pm.

• 3pm to 10:01pm is charged as one entry: $5.00

• Additional fee for exiting after 10pm: $3.00

• Total fee = $5.00 + $3.00 = $8.00


Example 4: Thursday, 11:49pm to 11:59pm.

• Grace period

• Total fee = $0.00


Example 5: Monday, 12pm to 10:01pm.

• 12pm to 6pm is charged as 12 30-minute slots: $1.20 * 12 = $14.40

• 6pm to 10:01pm is charged as one entry: $5.00

• 10% Surcharge for parking more than 10 hours: ($14.40 + $5.00) * 10% = $1.94

• Additional fee for exiting after 10pm: $3.00

• Total fee = $14.40 + $5.00 + $1.94 + $3.00 = $24.34

def compute_fee(day, time_in, time_out):
"""Your code here"""

Test Cases:
compute_fee(2, 429, 750) 8.4
compute_fee(6, 701, 1949) 48
compute_fee(7, 1500, 2201) 8
compute_fee(4, 2259, 2301) 0
compute_fee(1, 1200, 2201) 24.34

Answers

Here is the requested Python function that computes the parking fee based on the given information:

Question 2
An example of something that operates at the application layer is:

Answers

Answer:

HTTP, FTP, SMTP- These are protocols at the application layer

Explanation:

Which of the following statements is a possible explanation for why open source software (OSS) is free? A. OSS makes money by charging certain large corporations for licenses. B. OSS is typically lower quality than proprietary software. C. The OSS movement wants to encourage anyone to make improvements to the software and learn from its code. D. The OSS movement is funded by a private donor so it does not need to charge for its software licenses.

Answers

The statement that represents a possible explanation for why open-source software (OSS) is free is as follows:

The OSS movement is funded by a private donor so it does not need to charge for its software licenses.

Thus, the correct option for this question is D.

What is open-source software?

Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source code is openly shared so that people are encouraged to voluntarily improve.

Open-source software (OSS) is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and be marked by the user for a specific purpose in order to perform particular functions.

Therefore, the correct option for this question is D.

To learn more about Open-source software, refer to the link:

https://brainly.com/question/15039221

#SPJ1

Other Questions
Electricity travels in closed circuits, and its normal route is through a conductor. Electric shock occurs when: It is important to behave with civility in the workplace because it Multiple select question. indicates concern for others. helps makes the other persons in an argument look bad. demonstrates good character. sometimes calms a volatile situation. Write an equation of the line passing through the point (1,8) and parallel to y=3x+10 Harry is pedalling on a stationary bicycle, which lights up a signboard. What energy conversion takes place? How far do you agree that cartoons are for entertainment and nothing else? 600 words Eden is working on an experiment for her science fair project. She is planting a total of 10 herbs for an herb garden. She is going to plant basil and mint. The basil plants cost $.50 per plant and the mint plants cost $.25 per plant. Eden has a total of $3 to spend on plants because she also has to purchase potting soil and a long planter pot. Write a system of equations and solve either using elimination or substitution. PLEASE HELP I will give brainiest Which equation best shows the relationship between x and y? (1 point)O aObOcOdy = x + 50y = 6x + 50y = 6x + 56y=x+56 Writing Prompt Write an informative essay in which you explain how changes in teenagers' brains impact their behavior. Manage your time carefully so that you can read the passages;. . plan your response; write your response; and revise and edit your response. . What is the degree of the polynomial 5x 4x 7x? Assume that Job X used 70 direct labor-hours. How much manufacturing overhead would be applied to Job X Show that 100 divided by 20 is 5, using at least five daily life examples. Use logarithmic table to evaluate 40.790.003949 please helpDescribe the data you found. Explain what you learned from your communitys or a nearby communitys Community Health Improvement Plan. Explain what you learned from the data you found on the state department of healths webpage for health behaviors. Describe general trends and also give specific information and numbers. Refer to the notes you took for lesson 8.03. MEDICINE: Ahmad took 200 mg of a medication. The function f(t) = 200e 0. 4+ can be used to determine the amount of medication, f(t), still in his system after t hours. To the nearest hundredth, after how much time will Ahmad have only 50 mg of medication left in his system? A 4. 37 hours B 7. 47 hours C 3. 47 hours D 3. 74 hours A BH BO (please answer im stuck on this question) Match and identify the lettered features that are pointed out on the geologic map. Contour lines are in 50 ft increments.1. A Depression 2. B Steep area 3. C 2650 feet 4. D River flow East 5. E 3300 feet Does 12 20 and 16 form a Pythagorean triple? Eva loves to go fishing. Each time she catches a fish, there is a 70% chance that it is a northern pike and a 30% chance it is a walleye. Let W be the random variable that represents the number of walleye Eva gets if she catches 2 fish. 0 1 2 W = # of walleye P(W) 0. 49 0. 42 0. 09 Calculate the mean of W. walleye Write a story with a moral. y'd better see a doctor, tag question True or false: Minor acts of dishonesty and slight deviations from the truth are harmless and should be encouraged in business.