Min. 175 words
Discuss the structure of a Java™ program including files and arrays with GUI.
How do iterative structures differ from conditional structures in OOP?
Provide an example.
In: Computer Science
1-Give a BNF grammar (do not use EBNF) for the language that
generates the set of all strings consisting of the keyword begin,
followed by zero or more statements with a semicolon after each
one, followed by the keyword end. Use the non-terminal for
statements, and do not give productions for it.
2-Give a BNF grammar (do not use EBNF) for the language that
generates the set of all strings consisting of the keyword begin,
followed by one or more statements with a semicolon after each one,
followed by the keyword end. Use the non-terminal for statements,
and do not give productions for it.
3-Give a BNF grammar (do not use EBNF) for the set of all
strings consisting of zero or more as, with a comma
between each a and the next. (There should be no comma before the
first or after the last.)
4-Give a BNF grammar (do not use EBNF) for the set of all strings consisting of an open bracket (the symbol [) followed by a list of zero or more digits separated by commas, followed by a closing bracket (the symbol ]).
In: Computer Science
Using a text editor or IDE, copy the following list of names and
grade scores and save it as a text file named scores.txt:
Name, Score
Joe Besser,70
Curly Joe DeRita,0
Larry Fine,80
Curly Howard,65
Moe Howard,100
Shemp Howard,85
Create a JavaScript program of the files that display high, low,
and average scores based on input from scores.txt. Verify that the
file exists and then use string functions/methods to parse the file
content and add each score to an array. Display the array contents
and then calculate and display the high, low, and average score.
Format the average to two decimal places. Note that the program
must work for any given number of scores in the file. Do not assume
there will always be six scores and use Node Js as IDE.
In: Computer Science
Imagine a set Implementation which uses heaps, instead of binary search trees. How would performance of such a data structure differ from a set Implementation using Balanced Trees(AVL or Red/Black Trees)? Performance meaning RunTime(Time complexity) of the methods in the data structure ex. add()
In: Computer Science
Given the class below, which answer choice would be an implementation of the default constructor (without an initialization list)?
class MyInteger {
private:
int num;
public:
MyInteger();
MyInteger(int newint);
void setInt(int newint);
int getInt();
int operator[](int index);
};
MyInteger::MyInteger(int newNum) { num = newNum; }
MyInteger::MyInteger() { num = 0; }
MyInteger::MyInteger(int newNum = 0) { num = newNum; }
MyInteger::MyInteger(int newNum) : num{0} {;}
MyInteger::MyInteger(int newNum = 0) : num{0} {;}
MyInteger::MyInteger() : num{0} {;}
MyInteger::MyInteger(newNum) { num = newNum; }
In: Computer Science
Create a Factorial application that prompts the user for a number and then displays its factorial. The factorial of a number is the product of all the positive integers from 1 to the number. For example, 5! = 5*4*3*2*1. I also need an algorithm and pseudocode in java please
In: Computer Science
C++!!!
PLEASE PAY ATTENTION TO THE BOLD TEXT VERY WELL. THANK YOU
Write a program that creates three identical arrays, list1, list2, and list3, of 5000 elements. The program then sorts list1 using bubble sort, list2 using selection sort, and list3 using insertion sort and outputs the number of comparisons and item assignments made by each sorting algorithm.
Please use the file names listed below since your file will have the following components:
Ch18_Ex15.cpp
searchSortAlgorithms.h
In: Computer Science
***USING C++***
(a) Write a program that reads a text file in which each line in the file consists of a first name, a last name, following by 4 grades (double types) like Tim Hanes 78.3 98.0 80.5 72.3 The program must read every line of the text file, find the average of the 4 grades then print the names followed by the averages (one name per line) in a second file as well as on the monitor. Create the text file with at least 5 entries with the format given in part (a). Give the absolute path of the file in your computer. Test your program in part 2(a) on this file.
In: Computer Science
C++ , please answer both
1) Code a function object class which can scale data toward a desired maximum given the actual maximum and the desired maximum. (Reminder: to scale a value v use v*desired/actual.)
then after this
2) Show how to use your function object class from above to fix the following test scores. (What kind of loop would be most appropriate?) (Hint: What is the desired maximum of a typical test?)
double scores[MAX] = { 42, 55.5, 82, 74.5, 62 };In: Computer Science
Have you ever been in a situation in which you forgot a password and had a difficult time retrieving it? If so, in just a few sentences, write about how it made you feel and what you would do differently next time. If this has never happened to you, write about what you would do to keep track of the many passwords you use.
In: Computer Science
In Java, write a program that solves the following problem.
An arena can seat 12,000 people for an event. If the arena was full and you were to poll everyone for which day of the year (between 1 and 365, inclusive) they were born, determine which days had the most birthdays and which days had the fewest birthdays.
Write a program that will generate 12,000 random birthdays (integer numbers) between 1 and 365 and count how many people have that same birthday. Output a listing of the days that have the most birthdays and the days that have the fewest birthdays. You do not need to convert a number like 32 to an actual date (February 1st).
Do NOT change your class name from "Main". Your filename should be "Main.java".
Your code will have two classes:
The two classes can be part of the same file. A naive example structure is shown below.
public class Main{
public static void main(String args[]){
Arena a = new Arena();
a.printArena();
}
}
class Arena{
void printArena() {
System.out.println("I am arena");
}
}
Sample Output
The following days have 75 people:
147
The following days have 35 people:
143 312
In: Computer Science
Windows Server 2012 Inside Out Chapter 10 pages 369 to 395
In: Computer Science
Write a function that plots a spline curve for arbitrary x values if a solution for Ci is provided in vector form. Name the function spline_group and illustrate results.
Matlab Program
In: Computer Science
First, create a class object named SequenceMap that has as private data members the following two:
string recognition_sequence_ ;
vector enzyme_acronyms_;
Other than the big-five (note that you can use the defaults for all of them), you have to add the following:
a) A constructor SequenceMap(const string &a_rec_seq, const string &an_enz_acro),that constructs a SequenceMap from two strings (note that now the vector enzyme_acronyms_ will contain just one element, the an_enz_acro).
b) bool operator<(const SequenceMap &rhs) const, that operates based on the regular string comparison between the recognition_sequence_ strings (this will be a one line function).
c) Overload the operator<< for SequenceMap.
d) void Merge(const SequenceMap &other_sequence). This function assumes that the object’s recognition_sequence_ and other_sequence.recognition_sequence_ are equal to each other. The function Merge() merges the other_sequence.enzyme_acronym_ with the object’s enzyme_acronym_. The other_sequence object will not be affected.
Please test it with your own test functions to make sure that it operates correctly.
Please also show the test functions that you utilize so I can also implement it.
thank you.
In: Computer Science
What decimal number does the bit pattern 11001100 represent if it is a unsigned integer?
In: Computer Science