1. Draw a use case diagram for the selected project and identify the classes in the domain with attributes, functions, and relationships among classes. (State your assumptions clearly).
2. Design a database for the selected project. Please draw the following diagrams necessary to develop your database.
a. ER-diagram (Entity-relationship diagram)
b. Normalization of the database up to 3rd normal form. (Only if needed, if not needed justify).
My selected project is:
Develop a system to automate membership details and time allocation for swimmers in a swimming club. All users should take membership and pay monthly for usage. Usage could be with a coach or without. The program should produce and income report for a given month
In: Computer Science
Complex numbers using overload constructor and private parameters in C++
I don't know why my code does not compile......
please DO NOT CHANGE THE MAIN....
complexDriver.cpp
#include <iostream>
#include "complex.h"
using namespace std;
int main( ) {
// Ex) complex(4.0, 3.0) means 4.0+3.0i.
complex c1, c2( 1.2, 4.9 ), c3( 2.2, 1.0 ), c4( -7.0, 9.6 ),
c5(8.1, -4.3),
c6(0.0, -7.1), c7(6.4), c8(0.0, 1.0), c9(0.0, 4.1), c10(0.0, -1.0),
c11;
cout << "c1 = " << c1 << endl;
cout << "c2 = " << c2 << endl;
cout << "c3 = " << c3 << endl;
cout << "c4 = " << c4 << endl;
cout << "c5 = " << c5 << endl;
cout << "c6 = " << c6 << endl;
cout << "c7 = " << c7 << endl;
cout << "c8 = " << c8 << endl;
cout << "c9 = " << c9 << endl;
cout << "c10 = " << c10 << endl;
cout << "c11 = " << c11 << endl;
}
complex.h
#ifndef COMPLEX_H
#define COMPLEX_H
#include <iostream>
using std::istream;
using std::ostream;
class complex{
// Stream I/O
friend ostream& operator<<(ostream &, const complex
&);
friend istream& operator>>(istream&,
complex&);
public:
double getReal() const; // getter
void setReal(double x); // setter
double getImaginary() const;
void setImaginary(double y);
// Ex) complex(4.0, 3.0) means 4.0+3.0i.
complex(double x= 0.0, double y= 0.0); // default constructor
private:
double Real;
double Imaginary;
};
#endif // COMPLEX_H
complex.cpp
#include <iostream>
#include "complex.h"
using std::cout;
using std::endl;
double complex::getReal() const{ // getter
return Real;
}
void complex::setReal(double x){ // setter
Real = x;
}
double complex::getImaginary() const{
return Imaginary;
}
void complex::setImaginary(double y){
Imaginary = y;
}
// X= real part, Y = imaginary part. real number = X+Yi
// Ex) complex(4.0, 3.0) means 4.0+3.0i.
complex::complex(double x, double y){ // default constructor
setReal(x);
setImaginary(y);
}
// Stream I/O
ostream& operator<<(ostream &out, const complex
&c){
out<< c.x<<"+"<< c.y<< "i";
return out;
}
In: Computer Science
Instructions: Digital submission in PDF format (you can use Word
or Markdown to create these and then convert to PDF). Your
submission must include all R code.
I will be testing all of your code by copying and pasting into my R
session, so make sure it works. Your solutions should be a
narrative that incorporates R code (i.e. tell a story). R code by
itself is not sufficient. This must be entirely an original work
done by you. Copying someone else’s work (possibly found online) is
not acceptable.
Assignment:
1) In homework 2, you gave the name of a site you would like to scrape. Follow through with this (you may change the site if you wish). The point of this exercise will be to ultimately provide an interesting visualization of the data which needs to be included in your solution. For this problem, the data must be scraped. Provide why you chose this site, and how someone would find your visualization useful (in other words, justify why anyone would care about this).
In: Computer Science
Given the information below, create the fully labeled Crow's Foot ERD using a specialization hierarchy where appropriate (use Visio). The ERD must contain all primary keys, foreign keys, and main attributes. Business rules are defined as follows: A small company sells products on-line. Each product is supplied by one supplier. Each supplier delivers only one product. Each product belongs to one of the following categories: Books, Movies, or CDs. All products have common attributes - a product code, a title and a price- and attributes that are unique for each group of products. The list of such attributes includes but is not limited to the following: the publisher name (books), the format (movies), and the rating (CDs). In addition, customers may purchase a book (hardcover or paperback) or its' electronic version. For regular books, the company wants to record the number of pages per book. For electronic books, the format and the size of the file must be recorded.
In: Computer Science
1, If we want to display output from a command, such as DIR or TYPE, one screen at a time, we can use what kind of command?
> MORE
| PAGE
| MORE
>> PAGE
2, To delete a directory that contains subdirectories and/or files, we will use what command:
DEL directory name /S
MD directory name /S
RD directory name /S
RMDIR directory name
3, When we are using certain tools (e.g. WMIC, DISKPART, and NETSH) in the Interactive Mode, most of the internal Command Prompt commands, such as CLS and CD, would not work. However, which command will work?
BYE
EXIT
| MORE
START
4, When we use this command in a batch file, the user must pick from the available options because Command Prompt won't let s/he pick anything else:
CHOICE
IF ELSE
FOR
SET
In: Computer Science
Hi Can someone explain how the the output was achieved in details for this java question?
public class Example
{
public static void main(String [] args)
{
int a = 6, b = 5, i , num1, num2;
for (i = 1; i <= 3; ++i)
{
num1 = method1(a, b);
num2 = method2 (a, b);
System.out.println (num1 + " " + num2);
a = a + 2;
b = b - 1;
}
}
public static int method1 (int c, int d)
{
c = c + d;
return c;
}
public static int method2 (int e, int f)
{
f = f + e * 2 ;
return f ;
}
}
output
run:
11 17
12 20
13 23
In: Computer Science
Python
1. Change the order of an input string based on Unicode equivalent.
Write a function Reorder that will take an input string of a maximum length of 20 characters and create a new string that reorders the string based on it’s binary Unicode character equivalent, e.g. ‘a’ = 0x61, ‘A’ = 0x41, from smallest value to largest value. In this example, ‘A’ would come before ‘a’, as 0x41 is a smaller number than ox61. Note, use python logical operators to do the comparison. Do not try to create a Unicode lookup table. For your code, use the string “sum=(x*259)/average” as your input string to your function.
In: Computer Science
Show the values contained in the instance variables elements and numElements of the sample collection after the following sequence of operations:
ArrayCollection<String> sample = new ArrayCollection<String>; sample.add("A"); sample.add("B"); sample.add("C"); sample.add("D"); sample.remove("B");
//---------------------------------------------------------------------------
// ArrayCollection.java by Dale/Joyce/Weems Chapter 5
//
// Implements the CollectionInterface using an array.
//
// Null elements are not allowed. Duplicate elements are
allowed.
//
// Two constructors are provided: one that creates a collection of
a default
// capacity, and one that allows the calling program to specify the
capacity.
//---------------------------------------------------------------------------
package ch05.collections;
public class ArrayCollection<T> implements
CollectionInterface<T>
{
protected final int DEFCAP = 100; // default capacity
protected T[] elements; // array to hold collection’s
elements
protected int numElements = 0; // number of elements in this
collection
// set by find method
protected boolean found; // true if target found, otherwise
false
protected int location; // indicates location of target if
found
public ArrayCollection()
{
elements = (T[]) new Object[DEFCAP];
}
public ArrayCollection(int capacity)
{
elements = (T[]) new Object[capacity];
}
protected void find(T target)
// Searches elements for an occurrence of an element e such
that
// e.equals(target). If successful, sets instance variables
// found to true and location to the array index of e. If
// not successful, sets found to false.
{
location = 0;
found = false;
while (location < numElements)
{
if (elements[location].equals(target))
{
found = true;
return;
}
else
location++;
}
}
public boolean add(T element)
// Attempts to add element to this collection.
// Returns true if successful, false otherwise.
{
if (isFull())
return false;
else
{
elements[numElements] = element;
numElements++;
return true;
}
}
public boolean remove (T target)
// Removes an element e from this collection such that
e.equals(target)
// and returns true; if no such element exists, returns
false.
{
find(target);
if (found)
{
elements[location] = elements[numElements - 1];
elements[numElements - 1] = null;
numElements--;
}
return found;
}
public boolean contains (T target)
// Returns true if this collection contains an element e such
that
// e.equals(target); otherwise, returns false.
{
find(target);
return found;
}
public T get(T target)
// Returns an element e from this collection such that
e.equals(target);
// if no such element exists, returns null.
{
find(target);
if (found)
return elements[location];
else
return null;
}
public boolean isFull()
// Returns true if this collection is full; otherwise, returns
false.
{
return (numElements == elements.length);
}
public boolean isEmpty()
// Returns true if this collection is empty; otherwise, returns
false.
{
return (numElements == 0);
}
public int size()
// Returns the number of elements in this collection.
{
return numElements;
}
}
In: Computer Science
Draw a landscape image using python coding.
In: Computer Science
USE JAVA
Write a static generic method PairUtil.minmax that computes the minimum and maximum elements of an array of type T and returns a pair containing the minimum and maximum value. Require that the array elements implement the Measurable interface of Chapter 10.
In: Computer Science
reate a class Song with the data members listed below:
Include the following member functions:
You only need to write the class definition and any code that is
required for that class (i.e., header and implementation).
NOTE: you must not use the implicit "private" for class data types
and methods. Include public or private explicitly.
In: Computer Science
In C++, create two vectors, one a vector of ints and one a vector of strings. The user will fill each one with data, and then your program will display the values.
Sample Output
The following is an example of output for this program:
Enter int: 3
Enter int: 12
Enter int: 4
Enter int: 0
Your list is:
3
12
4
Enter string: The
Enter string: quick
Enter string: brown
Enter string: fox
Enter string: jumps
Enter string: over
Enter string: the
Enter string: lazy
Enter string: dog
Enter string: quit
Your list is:
The
quick
brown
fox
jumps
over
the
lazy
dog
In: Computer Science
Can I get detailed explanation about the following topics
Keyword Queries
Boolean Queries
Phrase Queries
Proximity Queries
Natural Language Queries
Wildcard Queries
Rather than the solution for Chapter 27, proplem 18RQ in Fundamentals of database system (6th Edition) and also provide me with examples
Regards
In: Computer Science
using java. using eclipse. write a program that asks to enter 3 real numbers using GUI. print the sum if all 3 numbers are positive, print the product of the 2 positive numbers if one is negative, use one nested if statement. all output should be to dialog and the console. ...... So i have most of this program done, i just cant figure out how to get the product of the 2 positve numbers to print to the console and dialog. Here is what I have so far.... i know the if and else if statements are correct, i just dont know how to get the if and else if to print to console and dialog correctly for the product.
import java.util.Scanner;
import javax.swing.JOptionPane;
public class Project3 {
public static float getFloat(){
String s = JOptionPane.showInputDialog("Enter a real
number");
return Float.parseFloat(s);
}
public static void main(String[] args) {
float x = getFloat();
float y = getFloat();
float z = getFloat();
// if all three are positive print the sum
if(x>0 && y>0 && z>0)
System.out.printf("Sum:%8.2f\n", (x+y+z));
//if two of the three are positive print the
product
else if((x>0 && y>0 &&
z<0)||(x>0 && y<0 && z>0)||(x<0
&& y>0 && z>0));
System.out.printf("Product:%8.2f",((x*y)||(x*z)||(y*z)));
JOptionPane.showMessageDialog(null,
"Sum:"+(x+y+z)+"\nProduct:"+((x*y)||(x*z)||(y*z)));
Scanner scan=new Scanner(System.in);
System.out.println("\nEnter 2 real numbers");
// if both are negative print the quotient
float a = scan.nextFloat();
float b = scan.nextFloat();
if(a<0 && b<0)
System.out.printf("Quotient:%8.2f", (a/b));
JOptionPane.showMessageDialog(null,
"Quotient:"+(a/b));
System.exit(0);
}
}
In: Computer Science
*I JUST WANT A GENERAL WALKTHROUGH OF HOW TO DO THIS. PSEUDOCODE IS FINE. THANK-YOU. THIS IS IN C THE PROGRAMMING LANGUAGE.*
The program will require the following structure:
struct _data {
char *name;
long number;
};
The program will require command line arguments:
int main(int argv, char **argc) {
Where argv is the number of arguments and argc is an array
holding the arguments (each is a string). Your program must catch
any case where no command line arguement was provided and print
a warning message (see below).
You MUST include/use the following functions, defined as follows:
int SCAN(FILE *(*stream)) - this function will open the file/stream
and return an integer indicating how many lines there are. Note that
I need to pass stream, which is a pointer, by reference. So I am
passing this as a pointer to a pointer.
struct _data *LOAD(FILE *stream, int size) - this function will
rewind file, create the dynamic array (of size), and read in the
data, populating the _data struct dynamic array. Note that stream
is passed by value this time. The function then returns the populated
array of struct.
void SEARCH(struct _data *BlackBox, char *name, int size) - this function
will get the dynamic array of struct passed to it, the name we are looking
for, and the size of the array. This function will then search the dynamic
array for the name. See below for examples.
void FREE(struct _data *BlackBox, int size) - this function will free up
all of the dynamic memory we allocated. Take note of the number of times
malloc/calloc were called, as you need to free that same number.
Finally, the data file will be called hw5.data and will be formatted as:
ron 7774013
jon 7774014
tom 7774015
won 7774016
HINTS:
------
Functions that will make things much easier:
getline()
feof()
strtok()
atoi()
SAMPLE RUNS:
------------
Case 1 - No command line argument provided.
[yourname@chef junk]$ ./CS230-5
*******************************************
* You must include a name to search for. *
*******************************************
Case 2 - Provided name is NOT in the list.
[yourname@chef junk]$ ./CS230-5 joe
*******************************************
The name was NOT found.
*******************************************
Case 3 - Provided name is in the list.
*******************************************
The name was found at the 2 entry.
*******************************************
In: Computer Science