Questions
What would be the system objectives of an early learning(1st – 3rd grade) website? Please list...

What would be the system objectives of an early learning(1st – 3rd grade) website? Please list at least 10.

In: Computer Science

Topic: Database Design - Entity Relationship Modeling (Please answer the below question in 250 words or...

Topic: Database Design - Entity Relationship Modeling (Please answer the below question in 250 words or more). Thank you!

If you have an entity with 100 different attributes, what would be some strategies to model this entity? Why/Why not would you want to use a single entity? What are some questions you would want to know about the individual attributes?

In: Computer Science

I get an error in my code, here is the prompt and code along with the...

I get an error in my code, here is the prompt and code along with the error.

Write a spell checking program (java) which uses a dictionary of words (input by the user as a string) to find misspelled words in a second string, the test string. Your program should prompt the user for the input string and the dictionary string. A valid dictionary string contains an alphabetized list of words.

Functional requirements:

  1. For each word in the input string, your program should search the dictionary string for the given word. If the word is not in the dictionary, you program should print the message "Unknown word found" to standard output.
  2. After traversing the entire input string, your program should print a message describing the total number of misspelled words in the string.
  3. A dictionary string may contain words in uppercase, lowercase, or a mixture of both. The test string may also combine upper and lower case letters. You program should recognize words regardless of case. So if "dog" is in the dictionary string, the word "dOG" should be recognized as a valid word. Similarly, if "CaT" is in the dictionary string, the word "cat" she be recognized as a valid word.
  4. Within a string, a word is a white-space delimited string of characters. So the last word in "Hello world!" is "world!".

CODE:

dictionary.java

import java.io.*;
import java.util.*;

public class dictionary
{
public static void main(String args[]) throws Exception
{
     
  
   String dString;
   String uString;
  
   Scanner input=new Scanner(System.in);
  
   System.out.println("Enter distionary string :");
  
   dString = input.nextLine();
  
   System.out.println("Enter input string :");
  
   uString = input.nextLine();
  
   String[] dict = dString.split(" ");//split dictionay string and save to array fo string
  
   boolean found = false;
  
   //ieterate over dictionary string array
   for (String a : dict)
   {
       //compare and print message accordingly       
       if((uString.toLowerCase().compareTo(a.toLowerCase())) == 0)
       {
   System.out.println("word found!");
           found = true;
           break;
       }
   }
  
   if(found == false)
   {
       System.out.println("Unknown word found!");
   }
  
  
  
}
}

ERROR:

Main.java:4: error: class dictionary is public, should be declared in a file named dictionary.java
public class dictionary
^
1 error
compiler exit status 1

In: Computer Science

Using only <iostream>, implement a dynamic array. You are to build a class called MyDynamicArray. Your...

Using only <iostream>, implement a dynamic array. You are to build a class called MyDynamicArray. Your dynamic array class should manage the storage of an array that can grow and shrink. The public methods of your class should be the following:

MyDynamicArray(); Default Constructor. The array should be of size 2.

MyDynamicArray(int s); For this constructor the array should be of size s.

~MyDynamicArray();Destructor for the class.

int& operator[](int i); Traditional [] operator. Should print a message if i is out of bounds and return a reference to a zero value.

void add(int v); increases the size of the array by 1 and stores v there.

void del(); reduces the size of the array by 1.

int length(); returns the length of the array.

int clear(); Frees any space currently used and starts over with an array of size 2.

Here is a sample main.cpp file:
#include <iostream>
using namespace std;
#include "MyDynamicArray.cpp"
int main() {
MyDynamicArray x;
for (int i=0; i<100; i++){
x.add(i);
}
int sum = 0;
for (int i=0; i<x.length(); i++){
sum+=x[i];
}
cout << "The sum is : " << sum << endl;
for (int i=0; i<95; i++)
x.del();
x[60] = 27;

MyDynamicArray y(10);
for (int i=0; i<y.length(); i++) y[i] = i*i;
for (int i=0; i<200; i++){
y.add(i);
}
sum = 0;
for (int i=0; i<y.length(); i++){
sum+=y[i];
}
cout << "The sum is : " << sum << endl;
for (int i=0; i<195; i++)
y.del();
y[60] = 27;
for (int i=0; i<200; i++){
y.add(i);
}
sum = 0;
for (int i=0; i<y.length(); i++){
sum+=y[i];
}
cout << "The sum is : " << sum << endl;

}
Here is the output from the main.cpp above :
Doubling to : 4
Doubling to : 8
Doubling to : 16
Doubling to : 32
Doubling to : 64
Doubling to : 128
The sum is : 4950
Reducing to : 64
Reducing to : 32
Reducing to : 16
Out of bounds reference : 60
Doubling to : 20
Doubling to : 40
Doubling to : 80
Doubling to : 160
Doubling to : 320
The sum is : 20185
Reducing to : 160
Reducing to : 80
Reducing to : 40
Out of bounds reference : 60
Doubling to : 80
Doubling to : 160
Doubling to : 320
The sum is : 20195

In: Computer Science

How would you describe Structure of Management Information (SMI)? Also justify, how it is useful for...

How would you describe Structure of Management Information (SMI)? Also justify, how it is useful for a managed object?

In: Computer Science

Introduction to IS & IT IT101 What problems are caused by data redundancy? Can data redundancies...

Introduction to IS & IT

IT101

What problems are caused by data redundancy? Can data redundancies be completely eliminated when the database approach is used? Justify your answer in your own words.

In: Computer Science

You will write several classes for this program in Java. The name of all classes for...

You will write several classes for this program in Java. The name of all classes for this program will start with y2y3.

Concepts to be applied :

Classes and objects, inheritance, polymorphism

Assignment:

An electronic store, named carrefoure, services many customers. The customers’ orders for electronics are delivered. Carrefoure bills their customers once each month. At the end of each month, the regional store manager requests a report of all customers. In this program, you will develop the inheritance hierarchy for the program. The set of classes developed for the program will be used for future assignments.

            The superclass for this assignment will represent a Customer of Carrefoure.

            Some of the Customers will be tax exempt customers (will not pay taxes on the) but others will be non tax exempt customers (will pay tax on the bill balance at a given percent).

            The fields are the instance variables of the classes in the hierarchy:

  • Customer name (String)
  • Customer ID (numeric integer)

o            phone number (numeric integer)

o            Amount paid (numeric)

o            Reason for tax exemption (only for tax-exempt-customers) – String, for example: education, non-profit, etc

o            Tax percent (only for non-tax-exempt customers) – decimal, for example: .08 for 8%, .075 for 7.5%

The customers served by careffoure are of two types: tax-exempt or non-tax-exempt. The tax-exempt customer will have an instance field to store the reason for the tax exemptions: education, non-profit, government, other (String). The non-tax exempt customers, will have an instance field to store the percent of tax that the customer will pay (numeric) on the bill balance.

From the information provided, write a solution that includes the following:

A suitable inheritance hierarchy which represents the customers serviced by the office supply company. There should be 3 classes for this program. I suggest a Customer class and two suitable subclasses. The tax percent field only applies for a non-tax exempt customer. The reason for tax exemption only applies to a tax exempt customer.  

            For all classes include the following:

o            Instance variables

o            Constructors

o            Accessor and mutator methods

o            Suitable toString() methods

Write a class y2y3 which does the following in the main method:

            Create two objects for customers who are tax exempt and create two objects for customers who are non-tax exempt.

            Print all the information about the objects as shown below:

Output:

Non tax exempt customers:

1 PWC   $750   18002500830     0.08%   $60

2 E&Y   $970    18003409845     0.08%   $77.6

Tax exempt customers:

3 AHS   $255.50     19734508345             Non-profit

4 PIO      $500        18002708855           Non-profit

In: Computer Science

Use python. DO NOT use pres existing libraries. Suppose there exists a text file called "expressions.txt"....

Use python. DO NOT use pres existing libraries. Suppose there exists a text file called "expressions.txt". This file contains simple arithmetic expressions written in infix notation. Using the Stack class, write code to implement the Shunting Yard Algorithm to generate postfix expressions. Each expression in expressions.txt is written on a single line. Moreover, each expression contains only numbers comprising a single digit. Each token is separated by whitespace. Write each postfix expression generated to a file "answers.txt". Only consider the operations +, -, /, *, and ^.

In: Computer Science

I am trying to make a robot move (theoretically), some of my code does not work...

I am trying to make a robot move (theoretically), some of my code does not work in python. I am getting some errors. How can I fix it?

This is my code:

#!/usr/bin/env python.3

import time
import sys
import random


#Provide a Menu for the User
def main():
print("To control LED press 1")
print("To drive press 2")
print("To change motor speed press 3")
print("To control the Servo press 4")
while True:
option = int(input("Enter the numbers 1, 2, 3, or 4:"))
if option == 1:
LED()

elif option == 2:
Drive()

elif option == 3:
Speed()

elif option == 4:
Servo()

else:
print("Wrong letter or number, please try again.")


#Options for LED
def LED():
print("To turn led on press 5")
print("To turn led off press 6")
print("To exit press 0")
while True:
option = int(input("Enter numbers 5 or 6:"))
if option == 5:
led_on(0)

  
elif option == 6:
led_off(0)

elif option == 0:
main()

#Options for Drive control
def Drive():
print("To move forward press W")
print("To move right press D")
print("To turn left press A")
print("To move backwards press S")
print("To increase speed press T")
print("To decrease speed press G")
print("To stop press X")
print("To exit press Z")

while True:
option = input("Enter letters W , D, A, S, T, G, X, or Z:")
if option == "W":
fwd()
time.sleep(.3)

elif option == "D":
right()
time.sleep(.3)

elif option == "A":
left()
time.sleep(.3)
  
elif option == "S":
backwards()
time.sleep(.3)
  
elif option == "T":
increase()
time.sleep(.3)
  
elif option == "G":
decrease()
time.sleep(.3)

elif option == "X":
stop()

elif option == "Z":
main()


#Options for Motor speed functions
def Speed():
print("Set Speed press 7")
print("To exit press 0")
while true:
option = int(input("Enter number 7:"))
if option == 7:
Set_speed()

elif option == 0:
main()



#Options to control Servo
def Servo():
print("To move servo to the right press 8")
print("To move servo to the left press 9")
print("To move servo forward press 10")
print("To return to the menu press 0")
while True:
option = int(input("Enter numbers 8, 9, or 10:"))
if option == 8:
enable_servo()
servo(0)
time.sleep(1)
disable_servo()

elif option == 9:
enable_servo()
servo(180)
time.sleep(1)
disable_servo()

elif option == 10:
enable_servo()
servo(90)
time.sleep(1)
disable_servo()

elif option == 0:
main()

main()

In: Computer Science

Write the code of: – an abstract class called Creature – classes Player and Monster (derived...


Write the code of:
– an abstract class called Creature
– classes Player and Monster (derived from Creature)
– classes WildPig and Dragon (derived from Monster)

In the Creature class
– Define a string member, Creature Name, to store the class Creature’s name.(name should be dynamically allocated)
– Define Two virtual pure functions

• void DoAction() : Print the action of the object, and the actions have to be different from different classes.

• void DrawOnScreen() : Print the object’s name and call DoAction() belonging to the same class.
The class definition of Creature is:


Question: Implement the class Player, Monster, Dragon and Wildpig so that when execution the following code, the counsel shows the execution result as the following:

Counsel output:

Player <Kick_Ass> is attacking!!
Monster<UFO> is doing monster stuff!!
WildPig <I'm_Hungry> is Running!!
Dragon<I'm_the_Boss> is breathing Fire!!



Main function:
//==================================================
int main(){
Player hero("Kick_Ass");
Monster mon("UFO");
WildPig pig("I'm_Hungry");
Dragon drag("I'm_the_Boss");
Creature* object[4];
object[0]=&hero;
object[1]=&mon;
object[2]=&pig;
object[3]=&drag;
object[0]->DrawOnScreen();
object[1]->DrawOnScreen();
object[2]->DrawOnScreen();
object[3]->DrawOnScreen();

return0;
}
c++

In: Computer Science

Create program in Python (using import turtle): 1)includes draw_background function 2)draw_background function uses a loop to...

Create program in Python (using import turtle):

1)includes draw_background function

2)draw_background function uses a loop to draw a background from at least one shape

3)uses at least 2 turtles to draw scent

4)includes draw_shape function

5)includes function to draw primary object

6)includes main method which creates the drawing

In: Computer Science

How do you translate this pseudocode to regular code in C++? for i :1 to length(A)...

How do you translate this pseudocode to regular code in C++?

for i :1 to length(A) - 1

j = i

while j > 0 and A[j - 1] > A[j]

swap A[j] and A[j - 1]

j = j -1

In: Computer Science

The following functions have zero or more security issues given the way they are called in...

The following functions have zero or more security issues given the way they are called in the main() function. Identity these security issues and propose a compliant fix. You don’t need to consider the issues in the main() function.

1. setValue set the element at index in arr to value.

void setValue ( int * arr , int len , int value , int index ) {

                arr [ index ] = value ;

}

int main ( void ) {

                int arr [10];

                int value ;

                int index ;

                printf (" Enter the value :\ n ");

                scanf ("% d " , & value );

                printf (" Enter the position :\ n ");

                scanf ("% d " , & index );

                setValue ( arr , 10 , value , index );

                return 0;

}

2. createArray creates an int array of size len. It, then, initializes each element in the array with value.

int * createArray ( int len , int value ) {

                int * arr = ( int *) malloc ( sizeof ( int ) * len );

                memset ( arr , value , sizeof ( int ) * len );

                return arr ;

                }

int main ( void ) {

                int value ;

                int len ;

                printf (" Enter the value :\ n ");

                scanf ("% d " , & value );

                printf (" Enter the length :\ n ");

                scanf ("% d " , & len );

                int * arr = createArray ( len , value );

                if ( arr != NULL ) {

                                if ( len > 0) {

                                printf (" The first element is % d \ n " , arr [0]);

                                }

                free ( arr );

                }

return 0;

}

3. writeToFile asks the user to input a string and then write the entered string to “out.txt”.

void writeToFile () {

                char buffer [20];

                printf (" Enter the content :\ n ");

                scanf ("% s " , buffer );

                FILE * f = fopen (" out . txt " , " w ");

                fputs ( buffer );

                fclose ( f );

                }

int main ( void ) {

                writeToFile ();

                return 0;

}

4. sum returns the sum of two integers.

long long sum ( int a , int b ) {

                return a + b ;

                }

int main ( void ) {

                int a = 0;

                int b = 0;

                printf (" Enter a :\ n ");

                scanf ("% d " , & a );

                printf (" Enter b :\ n ");

                scanf ("% d " , & b );

                printf (" sum of a and b is % ld \ n " , sum (a , b ));

                return 0;

}

5. swap swaps the integer value stored in a and b.

void swap ( int * a , int * b ) {

                * a += * b ;

                * b = * a - * b ;

                * a = * a - * b ;

                }

int main ( void ) {

                int a = 0;

                int b = 0;

                printf (" Enter a :\ n ");

                scanf ("% d " , & a );

                printf (" Enter b :\ n ");

                scanf ("% d " , & b );

                swap (& a , & b );

                printf (" a is %d , b is % d \ n " , a , b );

                return 0;

}

In: Computer Science

Compare and explain the pros and cons of native, cross-platform and web mobile development ?

Compare and explain the pros and cons of native, cross-platform and web mobile development ?

In: Computer Science

How does the IT industry measure employers productivity in an agile shop? I'm looking for some...

How does the IT industry measure employers productivity in an agile shop?

I'm looking for some research and a synopsis of each metric.

In: Computer Science