Questions
Create a C++ program which will prompt the user to enter a password continually until the...

Create a C++ program which will prompt the user to enter a password continually until the password passes the following tests.

Password is 6 chars long

Password has at least 1 number

If the input does not match the tests, it will input a specific error message. "Pass must be 6 chars long."

If the input is allowed, print a message saying "Correct Password Criteria."

In: Computer Science

Algorithm design:Suppose that three types of parentheses are allowed in an expression: parentheses, square brackets, and...

Algorithm design:Suppose that three types of parentheses are allowed in an expression: parentheses, square brackets, and curly braces. Please design an efficient algorithm to determine whether the parentheses in the expression are correctly paired. Please write down the algorithm idea and steps.

Please explain what kind of data structure is used to solve the problem, and then give the specific algorithm steps

In: Computer Science

Hello. I'm trying to write down java code making stars whose numbers are determined by user...

Hello. I'm trying to write down java code making stars whose numbers are determined by user input on the console (each star's data are stored in ArrayList).

the class extends JFrame and its color, size(Zoom in and Zoom out), and location are changing every time.

Moreover, its angular rotation is changed at a certain determined degree.

Does anyone know how to write down the java code of this question?

In: Computer Science

Describe domain concept briefly. What are the benefits of domain infrastructure when comparing to workgroup networking?...

Describe domain concept briefly. What are the benefits of domain infrastructure when comparing to workgroup networking? Your elaboration using live example is required.

In: Computer Science

1 Demonstrate the use of local variables in a Java program that has 1 function 2...

1
Demonstrate the use of local variables in a Java program that has
1 function

2
Demonstrate the use of overloaded methods
each has three primitive parameters
two methods computes and returns the product to the calling method for printing
one method computes and prints the product; does not return a result

3
Demonstrate the use of overloaded constructors
Three constructors each initialize two variables
Three methods, 1 computes the radius of a circle, 1 computes the area of a rectangle, and area of sphere

In: Computer Science

n following code if variable n=0, a=5 and b=10 then what will be the value of...

n following code if variable n=0, a=5 and b=10 then what will be the value of variable ‘n’ after while loop executed. Show your working as well.

while(n<=(a^b)) { n++; } printf("%d",n)

In: Computer Science

Describe/explain IoT as a tech innovation that is reshaping the infrastructure of cities. Discuss the application...

Describe/explain IoT as a tech innovation that is reshaping the infrastructure of cities. Discuss the application of IoT in three service sectors, be sure to include the application groups, locations and devices

In: Computer Science

C Programming Question: Write a C - program to implement the following three operations: a) Breadth-first...

C Programming Question:

Write a C - program to implement the following three operations:

a) Breadth-first search using Adjacency List

b) Breadth-first search using Adjacency Matrix

c) Check whether a given graph is Bipartite using Breadth-first search (adjacency list).​​​​​​

Please take your time, but do submit the correct and full code. Thank you very much.

In: Computer Science

Circle Class (This is in JAVA) /** * Defines a basic shape with just area *...

Circle Class (This is in JAVA)

/**
 * Defines a basic shape with just area
 *
 * @author Jo Belle
 * @version 0.2 (10/05/2020)
 */
public class Shape{
    private double area;

    public Shape(){ area = 0.0; }
    public Shape( double a ){ this.area = a; }
    public void setArea( double a ){ area = a; }
    public double getArea(){ return area; }
    public String toString(){
        return "Shape:\n\tarea: " + area;
    }
}
/**
 * Create a simple Circle object
 *
 * @author Jo Belle
 * @version 0.2 (10/12/2020)
 */
public class ShapeDriver{
    public static void main( String[] args ){
        Circle cir = new Circle( );
        cir.setRadius( 5.0 );
        System.out.println( cir.toString() );
    }
}

Given the code above, write a Circle class (and save it in a file named Circle.java) that inherits from the Shape class. Include in your Circle class, a single private field double radius. Also include a method void setRadius(double r) (which also sets area) and a method double getRadius() (which also returns the current radius). Change the accessibility modifier for area in the Shape class to be more appropriate for a base class. Make sure that ShapeDriver's main() method executes and produces the following output:

Shape:
        area: 78.53981633974483
        radius: 5.0

Submit both your Circle.java and your Shape.java files.

In: Computer Science

Develop the following class: Class Name: ImprovedArrayBasedStack Access Modifier: public Implements: ImprovedStackInterface Instance variables Name: top...

Develop the following class: Class Name: ImprovedArrayBasedStack Access Modifier: public Implements: ImprovedStackInterface Instance variables Name: top Access modifier: private Data type: int Name: stack Access modifier: private Data type: T[] (an array of parameterized type) Constructors Name: ImprovedArrayBasedStack Access modifier: public Parameters: none (default constructor) Task: sets the value of top to -1 sets the stack to refer to an array of Objects with 100 elements which are type cast to T[] Name: ImprovedArrayBasedStack Access modifier: public Parameters: size (data type int) Task: sets the value of top to -1 sets the stack to refer to an array of Objects with the number of elements equal to the size parameter which are type cast to T[] Methods Name: push Access modifier: public Parameters: item (data type T, parameterized type) Return type: void Throws: StackFullException Task: if the value of top is less than the length of the stack minus 1 then increase the value of top by 1 and place the item at the top of the stack, otherwise throw a StackFullException with the message "Not enough room for one item" Name: push Access modifier: public Parameters: item1 (data type T, parameterized type), item2 (data type T, parameterized type) Return type: void Throws: StackFullException Task: if the value of top is less than the length of the stack minus 2, then increase the value of top by 1 and place item1 at the top of the stack, then increase the value of top by 1 and place item2 at the top of the stack, otherwise throw a StackFullException with the message "Not enough room for two items" Name: pop Access modifier: public Parameters: none Return type: void Throws: StackEmptyException Task: if the value of top is greater than -1 then remove the item at the top of the stack by replacing it with null and decrease the value of top by 1, otherwise throw a StackEmptyException with the message "No item to remove" Name: doublePop Access modifier: public Parameters: none Return type: void Throws: StackEmptyException Task: if the value of top is greater than 0, then remove the item at the top of the stack by replacing it with null and decrease the value of top by 1, then remove the item at the top of the stack by replacing it with null and decrease the value of top by 1, otherwise throw a StackEmptyException with the message "There are less than two items in the stack" Name: top Access modifier: public Parameters: none Return type: T (parameterized type) Throws: StackEmptyException Task: if the value of top is greater than -1 then return the item at the top of the stack, otherwise throw a StackEmptyException with the message "Top attempted on an empty stack"

In: Computer Science

Suppose you define the class myGrid in Java. Suppose further that my Image[][] is a variable...

Suppose you define the class myGrid in Java. Suppose further that my Image[][] is a variable defined to be a 2D array with 100 rows and 100 columns of type myGrid, and that the myGrid class has two methods: setX()and setY(). Write the Java code snippet to instantiate every cell of myImage[][]with myGrid objects, and use the setX()and setY()methods to store the row and the column location of each myGrid object in the array.

In: Computer Science

For this question you need to write some methods and class headers. (a) Assume that you...

  1. For this question you need to write some methods and class headers.

    1. (a) Assume that you have written a Rectangle class with instance variables length and width. You have already written all set and get methods and area and perimeter methods. Write an equals() method that takes Object o as a parameter. The method should return true when the Object o is a rectangle with the same length and width.

      Answer:

    2. (b) A class named Fruit implements an interface called Edible. The interface has a single method called howToEat(). A class called Orange extends Fruit and implements Edi- ble. Write the class header for the Orange class and override the howToEat() method of the Fruit class. The method should print a brief message to the screen about how to eat an orange. Do not write any other methods or constructors.

      Answer:

In: Computer Science

Choose a pivot using the median of 3 technique and show the result after 1 pass...

Choose a pivot using the median of 3 technique and show the result after 1 pass of quicksort (stop just before choosing a 2nd pivot) for the list [ 85, 40,60, 30, 55, 63, 70, 75 ,25]

In: Computer Science

Write the algorithm in pseudocode for scan-converting (filling in the interior) of an axis-aligned right triangle...

Write the algorithm in pseudocode for scan-converting (filling in the interior) of an axis-aligned right triangle (the base is aligned with the x-axis and the orthogonal leg is aligned with the y-axis).

In: Computer Science

Create a Java method that takes a String as input value and returns the number of...

Create a Java method that takes a String as input value and returns the number of vowels contained in that string.

In: Computer Science