Questions
Ask the user to enter test scores. Once they have entered -1, print out the highest...

Ask the user to enter test scores. Once they have entered -1, print out the highest grade. Ensure that the grade entered is an integer.(Using Java Language)

Enter integers between 0 and 100, -1 when finished.

Enter a test score: [asdf]

Enter an integer.

Enter a test score: [32.5]

Enter an integer.

Enter a test score: [42]

Enter a test score: [99]

Enter a test score: [87]

Enter a test score: [x]

Enter an integer.

Enter a test score: [-1]

The max grade is: 99

In: Computer Science

c++ For your program, you will choose either the Selection Sort algorithm or the Insertion Sort...

c++

For your program, you will choose either the Selection Sort algorithm or the Insertion Sort algorithm and create a recursive implementation of that algorithm. Your program should:

  1. Randomly generate an array of at least 20 values.
  2. Display the contents of that (unsorted) array.
  3. Use the recursive implementation of either Selection or Insertion Sort to sort the values.
  4. Display the contents of the now sorted array, to demonstrate the success of the algorithm.

In: Computer Science

In C language Write a program that includes a function search() that finds the index of...

In C language

Write a program that includes a function search() that finds the index of the first element of an input array that contains the value specified. n is the size of the array. If no element of the array contains the value, then the function should return -1. The program takes an int array, the number of elements in the array, and the value that it searches for. The main function takes input, calls the search()function, and displays the output. Name program part1.c

int search(int a[], int n, int value);

Example 1:

Enter length of array: 4

Enter elements of array: 8 2 3 9

Enter the value for searching: 2

Output: 1

Example 2:

Enter the length of the array: 6

Enter the elements of the array: 4 6 1 0 2 9

Enter the value for searching: 5

Output: -1

2. Modify the part 1 program so that it deletes all instances of the value from the array. As part of the solution, write and call the function delete() with the following prototype. n is the size of the array. The function returns the new size of the array after deletion (The array after deletion will be the same size as before but the actual elements are the elements from index 0 to new_size-1). In writing function delete(), you may include calls to function search(). The main function takes input, calls the delete()function, and displays the output. Name your program part2.c.

int delete(int a[], int n, int value);

Example 1:

Enter the length of the array: 6

Enter the elements of the array: 4 3 1 0 3 9

Enter the value for deleting: 3

Output array:

4 1 0 9

In: Computer Science

There are several typical cube computation methods such as Multi-Way, BUC, and Star-cubing. Briefly describe each...

There are several typical cube computation methods such as Multi-Way, BUC, and Star-cubing. Briefly describe each one of these methods outlining the key points.

In: Computer Science

(dominoes N) which returns a list containing the (N+1)(N+2)/2 tiles in a double-N domino set, with...

(dominoes N) which returns a list containing the (N+1)(N+2)/2 tiles in a double-N domino set, with each tile represented as a dotted pair (an improper list).

(dominoes 2) ⇒ ((2 . 2) (2 . 1) (2 . 0) (1 . 1) (1 . 0) (0 . 0))

using the programming language scheme

i need the question to be answered using the programming language Scheme

In: Computer Science

c++ Please read the whole question and instrucions. The instructor wants a function to convert string...

c++

Please read the whole question and instrucions.

The instructor wants a function to convert string to int to perform the bitwise operations then convert int to string back again to show results.

Question:Write a program that produces the bitwise OR, bitwise AND, and bitwise XOR of the bit strings
1001 0011 1011 and 1111 1010 0000.

Thank you in advance.

In: Computer Science

C++ Zybook LAB15.3.1: What order? (function templates Define two generic functions called GetVector() and CheckOrder(). GetVector()...

C++ Zybook LAB15.3.1: What order? (function templates

Define two generic functions called GetVector() and CheckOrder(). GetVector() takes a string of items delimited by spaces and an item of a generic type (i.e., char, int, double, or string) and returns a vector of the given item type. CheckOrder() checks if the vector of items is in ascending, neither, or descending order. The function should return 'a' if the items are in ascending order, 'u' if the items are unordered, and 'd' if the items are in descending order.

To test your functions, you are provided a main program which: Reads items from the input one line at a time, Uses a function called DataType() to determine the type of data (e.g., char, int, etc.) in the line, Constructs a vector of the appropriate type using your GetVector() function, and Then calls your CheckOrder() to output how the items are ordered. The items can be different types, including integers, strings, characters, or doubles.

Ex. If the input is: bat hat mat sat 63.2 196.5 123.5 the output is: Order: a Order: u

Code:

#include <string>
#include <sstream>
#include <iostream>
#include <vector>

using namespace std;

// TODO: Define a generic function called GetVector() that
// takes a string of items delimited by spaces and
// an item of a generic type (i.e., char, int, double,
// or string) and returns a vector of the given item
// type. The GetVector() function signature is below.
template <typename T>
vector<T> GetVector(string items, T item);

// TODO: Define a generic function called CheckOrder() that
// takes a vector of either char, double, int or string
// type as an argument and returns 'a' if the contents
// of the vector is ascending, 'd' if descending and 'u'
// if it is neither. A vector of zero or one items is
// considered 'u'. The CheckOrder() signature is below.
template <typename T>
char CheckOrder(vector<T> v);

char DataType(string items);

int main(int argc, char* argv[]) {
// Read in items
string items, str_item = "";
char char_item = ' ';
int int_item = 0;
double double_item = 0.0;;
vector<string> sv;
vector<int> iv;
vector<double> dv;
vector<char> cv;

getline(cin, items);
while (!cin.eof()) {
// check for the type of data: DataType returns 'c' for char,
// 'd' for double, 'i' for int, and 's' for string
char type = DataType(items);

// populate the vector
switch (type) {
case 'c': cv = GetVector(items, char_item);
cout << "Order: " << CheckOrder(cv) << endl;
break;
case 'd': dv = GetVector(items, double_item);
cout << "Order: " << CheckOrder(dv) << endl;
break;
case 'i': iv = GetVector(items, int_item);
cout << "Order: " << CheckOrder(iv) << endl;
break;
default : sv = GetVector(items, str_item);
cout << "Order: " << CheckOrder(sv) << endl;
break;
}
getline(cin, items);
}

return 0;
}

char DataType(string items) {
bool chars = true;
bool strings = true;
bool ints = true;
bool doubles = true;

for (auto c : items) {
if (isalpha(c)) { ints = false; doubles = false; }
if (c == '.') { ints = false; }
}

if (ints) { return 'i'; }
if (doubles) { return 'd'; }

stringstream ss(items);
string s;

while (ss >> s) {
if (s.length() > 1) { chars = false; }
}

if (chars) { return 'c'; }

return 's';
}

In: Computer Science

Views are virtual in database but Materialized view are persistent. Discuss the need to have materialized...

Views are virtual in database but Materialized view are persistent. Discuss the need to have materialized view instead of views and in what condition No materialization if preferred.

In: Computer Science

Write a C++ program which performs a rot 13 substitution. Must be in C++. Thank you.

Write a C++ program which performs a rot 13 substitution. Must be in C++. Thank you.

In: Computer Science

Scientific Computing course - I honestly dont know what this question means, we use python in...

Scientific Computing course - I honestly dont know what this question means, we use python in this course. Not sure if that helps with answering this question.

Write an algorithm/pseudo code to transpose an nxn matrix.

In: Computer Science

Specify any four difference between Client/Server computing and Peer-to-Peer computing. Which architecture used by Bitcoin digital...

Specify any four difference between Client/Server computing and Peer-to-Peer computing. Which architecture used by Bitcoin digital currency?

In: Computer Science

The Central Processing Unit consist of three main units. List these three units and discuss the...

The Central Processing Unit consist of three main units. List these three units and discuss the functionality of each.

In: Computer Science

Turn Think of your favorite place to shop. Write a program that will create a form...

Turn Think of your favorite place to shop. Write a program that will create a form for your favorite store using the PHP Application The form should include fields for contact information and at least three(3) items to order from. It should calculate the order and display a subtotal before tax and a total after tax. This is your final project, so add background color, pictures, and anything else that you thin

In: Computer Science

Goals In this assignment you must use Java language to program the small application for a...

Goals

In this assignment you must use Java language to program the small application for a grocery buyer.

You will create meaningful utility that implements

  1. simple math model for real problem;
  2. design of the application logic;
  3. basic user interface.

The implementation plus coding style and efficiency will be graded.

Description

The supermarket uses three pricing scenarios for the local products –

  1. Monday, Wednesday, and Friday, the product A has fixed regular price of X dollars.
  2. Tuesday and Thursday, the product A has price of X dollars, but you can buy three A-product items for Y dollars with 10% discount (Y = 3 * X * 90%).
  3. On the weekend, the product A has price of X dollars, but you can buy two and get one for free.

Your application must calculate how much you pay for one item depending on a regular price, day of the week, and number of items.

For example, yogurt has regular price of $3. Then, if you buy 3 yogurts on Sunday your spending will be $2 per item.

It is not as simple as it first appears. Consider the following questions before programming:

  1. Are price and how much you pay the same things?
  2. In the scenarios 2 and 3, how much you pay for one item if you buy 4 or 5?
  3. What is the money value of 1000 item if the product is priced using scenario 2?
  4. Does fractional money exist?

Program requirements

  1. The inputs for your program are name of the product, regular price for the product, number of items, and day of the week. You may use information from any local grocery store to create a list of 5-7 products to test your program.
  2. Your program must calculate how much you pay for the one unit of the product.
  3. The output must be in a form “… dollars … cents.”
  4. The program must run until the user decides to quit.
  5. The program must use methods and branches.
  6. Rounding to the cents must be programmed (do not use standard methods).


There is no any sample run, just need a JAVA program to conform the above requirements.

In: Computer Science

complete all methods in java! /* Note:   Do not add any additional methods, attributes.         Do...

complete all methods in java!
/*
Note:   Do not add any additional methods, attributes.
        Do not modify the given part of the program.
        Run your program against the provided Homework2Driver.java for requirements.
*/

/*
Hint:   This Queue implementation will always dequeue from the first element of
        the array i.e, elements[0]. Therefore, remember to shift all elements
        toward front of the queue after each dequeue.
*/

public class QueueArray<T> {
    public static int CAPACITY = 100;
    private final T[] elements;
    private int rearIndex = -1;
   
    public QueueArray() {
    }

    public QueueArray(int size) {
    }
   
    public T dequeue() {

    }
   
    public void enqueue(T info) {

    }
   
    public boolean isEmpty() {
       
    }
   
    public boolean isFull() {
       
    }
   
    public int size() {
       
    }
}

In: Computer Science