Name the project pa3 [Method 1] In the Main class, write a static void method to print the following text by making use of a loop. Solutions without a loop will receive no credit. 1: All work and no play makes Jack a dull boy. 2: All work and no play makes Jack a dull boy. 3: All work and no play makes Jack a dull boy. 4: All work and no play makes Jack a dull boy. [Method 2] In the Main class, write a static method that accepts an array of floating point parameters. The three elements in the array can be labeled as a, b, and c from first to last. The method computes and returns the results of the quadratic equation in a separate two-element array given by the following equation: −b ± √( b^2 − 4 · a · c) / (2 · a), as long as the discriminant (b^2 − 4 · a · c) is non-negative. Otherwise, return a reference to an array object with zeros in both elements. [Method 3] In the Main class, write a static void method that receives three Strings and prints them in reverse dictionary order, Z to A. Tips: Should the result of the following example be positive: callingString.compareTo(otherString), callingString will appear after otherString in the dictionary. There are six possible orderings of 3 items, so you should not need more than 5 nested if statements. Another option is to place the Strings into an array, use the Arrays.sort static method, and traverse the array backwards. [Method 4] In the Main class, write a static method that receives a String parameter named option. The method then returns one of the following String literals based on the return value of option’s length() function. When option has fewer than 10 characters, return “too small”. When option has more than 10 characters, return “too big”. When option has exactly 10 characters, return “just right”. In the main method, write the Java code to receive the needed actual parameters from the user for each method and call each method. For instance, the three numbers required for Method 2 should be read from the user. Also include the appropriate prompts instructing the user what to enter. Requirements 1) A reference variable and instance object of class java.util.Scanner must be used to read the input from the user. 2) Identifiers must be descriptive (i.e., must self document). 3) Indention of all code blocks (compound statements, code inside braces), including single statements following selection or while statements, is required.
In: Computer Science
(Programming Language: Python)
Complete the function remove number such that given a list of
integers and an integer n, the function removes every instance
of
n from the list. Remember that this function needs to modify the
list, not return a new list.
# DO NOT ADD ANY OTHER IMPORTS from typing import List
def remove_number(lst: List[int], number: int) -> None:
"""
Remove every instance of number in lst. Do this *in-place*, i.e. *modify* the list. Do NOT return a new list.
>>> lst = [1, 2, 3]
>>> remove_number(lst, 3)
>>> lst
[1, 2]
"""
pass
In: Computer Science
Write an implementation of the ADT stack that uses a resizeable array to represent the stack items. Anytime the stack becomes full, double the size of the array. Maintain the stack's top entry at the beginning of the array.
Use c++ to write this code.
In: Computer Science
In: Computer Science
Information Technology (IT) is an application of computers and telecommunications which stores, retrieves, transmits and manipulates data. It also encompasses other information technologies of a ubiquitous nature.
Describe using appropriate examples the ubiquitous nature of IT in the following cases. Clearly explain the input-output mechanism.
1. Wearable Computer
2. In the New Metro Express Project
In: Computer Science
Data must possess some key characteristics. Using example of a wearable computer, elaborate on the following: RELIABLE, TIMELY, And COMPLETE
In: Computer Science
I'm trying to convert between different number representations in C++ , I have the prototype but im not sure what do do from here
bool convertU(unsigned & n, const string & bits);
bits should have size exactly 5, and each char of bits should be '0' or '1'; otherwise
return false.
If bits is ok, set n to the number that bits represents as an unsigned and return true.
For example, convertU(n, "0101") and convertU(n, "10210") should return false;
convertU(n, "10011") should set n to 19 and return true.
In: Computer Science
In data normalization, the removal of partial dependencies is associated with the transition from ________.
Select one:
a. Poorly structured data to first normal form (1NF)
b. First normal form (1NF) to second normal form (2NF)
c. Second normal form (2NF) to third normal form (3NF)
d. Third normal form (3NF) to Boyce-Codd normal form (BCNF)
Although the idea of a foreign key is useful for conceptual data modeling purposes, it is not actually possible to implement a foreign key in a real-world DBMS.
Select one:
a. True
b. False
Compared to the non-normalized design from which it was derived, a normalized database design will typically contain ________ inter-table relationships.
Select one:
a. More
b. Fewer
c. An equal number of
d. Zero
All of the following anomalies EXCEPT ________ can arise when using a list to store data.
Select one:
a. Deletion problems
b. Update problems
c. Query problems
d. Insertion problems
A referential integrity constraint can be used to verify that the values of a column in one table are valid in light of the values of a column in another table
Select one:
a. True
b. False
In: Computer Science
2 Write a Java program called Pattern that prints an 8-by-8 checker box pattern using an if loop.
In: Computer Science
Write a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using the JOptionPane statement and a System. Out statement to output a message inside the loop highlighting a pass mark >= 50 and <= 100. Any other mark will output a messaging stating it’s a fail.
In: Computer Science
PLEASE USE PYTHON CODE
7. determine the two roots of sinx+3cosx-2 =0 that lie in the interval (-2,2). use the Newton- Raphson method and solve by the secant formula
In: Computer Science
Translate the following C program to Pep/9 assembly language:
#include <stdio.h>
char toLower(char ch)
{
if (ch >= 'A' && ch <= 'Z' )
ch += 'a' - 'A';
return ch;
}
int main()
{
char ch, conversion;
printf("Enter an uppercase letter: ");
scanf("%c", &ch);
conversion = toLower(ch);
printf("\nLetter after conversion: %c\n\n", conversion);
return 0;
}
In: Computer Science
4 Write an algorithm to settle the following questions:
Accept a starting balance (For example :A bank account starts out with $10,000) Accept an Interest rate (For example: 6 percent per year is 0.005 percent per month).
Accept an amount to withdraw every month (For example: Every month, $500 is withdrawn to meet college expenses.)
After how many years is the account depleted? (You are to loop and find out how many months this will take) (For example: Suppose the values ($10,000, 6 percent, $500) were user selectable, then how many months would it take to deplete the account?)
Are there values for which the algorithm you developed would not terminate? (For example if the interest calculated for each month exceeds the withdrawal every month). If so, change the algorithm to make sure it always terminates.
Don't write the program, just write it in pseudo
English.
In: Computer Science
Software Testing Question
Program P2 CFG.
a) Identify the basic blocks for the following program P2 written in pseudo-code.
b) Draw the control flow graph.
Program P2
1) integer A, B;
2) input (A);
3) B = 1;
4) while (int i=1; i<=A; i++)
5) {
6) B = B * i;
7) if (B>13)
8) B = B / 2;
9) else 1
0) B = B * 2;
11) }
12) output (A,B);
13) end;
In: Computer Science
String Input Console Application and Program Analysis
Demonstrate an understanding of basic C++ programming concepts by completing the following:
In: Computer Science