Questions
Two numbers a and b are called pythagorean pair if both a and b are integers...

Two numbers a and b are called pythagorean pair if both a and b are integers and there exists an integer c such that a2 + b2 = c2. Write a function pythagorean_pair(a,b) that takes two integers a and b as input and returns True if a and b are pythagorean pair and False otherwise.

In: Computer Science

#C language array must store at least 50 inputs Game Scores Assignment Outcomes: Demonstrate the ability...

#C language

array must store at least 50 inputs

Game Scores Assignment

Outcomes:

  • Demonstrate the ability to create a menu driven program.
  • Demonstrate the ability to create and use a 2D array on the stack.
  • Demonstrate the use of functions.
  • Demonstrate good programming style.

Program Specifications:

Your program will read in "game scores" from the user. Each score consists of a score for YOUR team and a score for the OTHER team. You don't need names or dates for the games. Just the scores. You'll use a 2D array to store the scores. The following menu options all need to be implemented:

***********************************************

**                 MAIN   MENU                     **

***********************************************

A) Enter game result

B) Current Record (# of wins and # of losses and # of ties)

C) Display ALL results from all games WON

D) Display ALL results ordered by opponent score from low to high.

E) Quit

Create a menu similar to the example above. The user will enter a single game result at a time.  All menu options should be implemented within programmer-defined function. Functions should be used as much as possible.

Submission Requirements:

Requirements will be same as the first assignment which will be the same for all future assignments.

YOU MAY NOT

  • Use global variables, in this or any program ever.
  • Use goto statement(s), in this or any program ever.

In: Computer Science

Suppose you are converting 273332 (base 10) to base 2 using the subtraction method. What is...

Suppose you are converting 273332 (base 10) to base 2 using the subtraction method. What is the decimal number you have left for conversion after 3 steps?

In: Computer Science

You are asked to create to to-do list program to store and manage to-do items for...

You are asked to create to to-do list program to store and manage to-do items for user.

You need to define a class to-do item which holds the following attributes:

• Id => number, generated by the program when item is created

• Title => string • Description => string

• Type (e.g. shopping, housing, work, etc.) => Enum

• Priority => number between 1 to 5

• Status => (e.g. done, in progress, hold, etc.) => Enum

• Create date => date struct, to be set on creation

• Due date => date struct

• Last modified date => date struct, to be changed every time user makes a change

Write (3) three different constructors beside default constructor to initialize:

1. Title, Description, Type

2. Title, Type, Priority,

3. Title, Type, Priority, Due date Write set / get function of each of the attribute defined above.

You are required to define a to-do list class which holds a one dimension array of to-do objects with MAX_SIZE = 100 and the list of the following functions:

• Constructor: to initialize an empty to-do list

• Copy constructor: to initialize to-do list from another to-do list

• Add to-do item: ask the user to enter the attributes for to-do item and then insert the to-do item to the bottom of the list

• Edit to-do item: ask the user which attribute to edit and then make the change to the existing to-do item

• Delete to-do item: ask the user for the id of to-do item to be deleted

• Delete multiple to-do item by type: ask the user for the type

• Delete multiple to-do item by status: ask the user for the status

• Write list to text file o Each line in the text file represent one to-do item, all attributes are written as comma separated

. • Read list from text file

• Sort list by: o Priority o Due date o Create date o Type with inner sort by: Priority Due date

• Print list to the console with different options: o All items o Filtered by type given by the user o Filtered by priority given by the user o One item by id given by the user

• Merge another to-do list: to define a function to pass an object of to-do list, the new items will be added to the bottom of the list

• Clone to-do list to another to-do list In addition, you need to define the following global functions:

• Copy to-do list items to 2 dimensional array, each row represents item’s type.

• Copy to-do list items to 3 dimensional array,

o Second dimension represents item’s type.

o Third dimension repreents the priority

In: Computer Science

Python. 5) What will the code below do? (Assume that we have a dataset df with...

Python.

5) What will the code below do? (Assume that we have a dataset df with these two columns named Occupation' and 'Age')

df.groupby('Occupation')['Age'].mean()

a) It will return the average age per occupation

b) It will return an error

c) It will return the total age per occupation

d) None of the options

6) df.describe() will return basic descriptive statistics only for numerical variables

True/False ?

7) Pandas dataframes can be converted into numpy arrays

Truse/False ?

In: Computer Science

Case Study; The FBI T his is a case about the virtual case file system, which...

Case Study; The FBI T

his is a case about the virtual case file system, which has caused FBI IT leaders many problems.

a) What do you think were the real reasons why the VCF system failed?

Need 300 words discussion,Don't rewrite already existing chegg answers

In: Computer Science

Write a program that takes in a positive integer as input, and outputs a string of...

Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:

As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1)

x = x / 2

Note: The above algorithm outputs the 0's and 1's in reverse order.

The code needs to be in Java

In: Computer Science

Python Code: Write a program to prompt the user to enter a first name, last name,...

Python Code:

  1. Write a program to prompt the user to enter a first name, last name, student ID, number of hours completed and GPA for 5 students. Use a loop to accept the data listed below. Save the records in a text file.
  2. Write a second program that reads the records from your new text file, then determines if the student qualifies for Dean’s list or probation. Display the records read from the file on screen with appropriate headings above the data being displayed. Save screenshot for submission.

If the GPA is >= 3.5, display 'Dean’s List'

If the GPA is < 2.0, display 'Dismissed’

If the GPA is < 3.5 and >= 2.0, display 'Regular Standing'

The data is as follows:

Mohammed James   012345 94 3.2  

Priya Jones 112245 45 3.9

George Wayne   013265 18 1.9

Jennifer Fulton   121378 30 2.0

Ayesha Smith       043245 64 3.5

In: Computer Science

1. Describe when to use cursor:     implicit cursor      explicit  cursor 2. Please give one example for each...

1. Describe when to use cursor:

  •     implicit cursor
  •      explicit  cursor

2. Please give one example for each of below statement:

  •    TCL -- Transaction Control statement
  •    DML -- Data Manipulation statement
  •    Implicit Cursor Attributes --  PL/SQL statement

In: Computer Science

In this assignment you will write a PHP program that reads from a data file, creates...

In this assignment you will write a PHP program that reads from a data file, creates an associative array, sorts the data by key and displays the information in an HTML table.

Create a PHP file called hw4.php that will do the following:

- Display your name.
- Read text data from a file. The data file is hw3.txt.

The file hw3.txt will hold the following text:

PQRParrot, Quagga, Raccoon
DEFDo statements, Else statements, For statements
GHIGeese, Hippos, If statements
YZ Yak, Zebra
JKLJelly Fish, Kudu, Lynx
MNOManatee, Nautilus, Octopus
ABCApples, Boas, Cats
VWXVulture, While statements, Xmen
STUSea Horse, Tapir, Unicorn

- Take the first three characters of each line read as the key and the rest of the line as the value or data.
- Create an associative array with the key and data.- Once all the data is in the array, sort the array by the key.
- Display the data as an HTML table. Below is what your finished table should look like.

Key Data
ABC Apples, Boas, Cats
DEF Do statements, Else statements, For statements
GHI Geese, Hippos, If statements
JKL Jelly Fish, Kudu, Lynx
MNO Manatee, Nautilus, Octopus
PQR Parrot, Quagga, Raccoon
STU Sea Horse, Tapir, Unicorn
VWX Vulture, While statements, Xmen
YZ Yak, Zebra

- Use repetition to complete this assignment.

In: Computer Science

Question 3: C-Strings and pointers (10 pts) [5] The following function appends C-string str2, to C-string...

Question 3: C-Strings and pointers (10 pts)

  1. [5] The following function appends C-string str2, to C-string str1. Complete the function using array access, i.e. str1[i], but no pointer access.

Note: For both part a) and part b) you may not use any library function calls (e.g. you cannot use strlen, strcat, etc.)

// Append strt2 to str1

void my_strcat(char str1[], char str2[])

{

//YOUR CODE HERE  

}

// example of using my_strcat()

#include <stdio.h>

int main(void)

{

char my_str1[50] = “hello ”;

char my_str2[] = “world”;

my_strcat(my_str1, my_str2);

// Printf should print: hello world.

printf(“%s \n”, my_str1);

}

  1. [5] Rewrite the above function, this time using pointer access, i.e. *str, but no array access.

Note: In general, a function’s parameter declarations “char str[]” and “char *str” are equivalent (i.e. they are interchangeable)

// Append strt2 to str1

void my_strcat(char* str1, char* str2)

{

// YOUR CODE HERE  

}

// example of using my_strcat()

#include <stdio.h>

int main(void)

{

char my_str1[50] = “hello ”;

char my_str2[] = “world”;

my_strcat(my_str1, my_str2);

// Printf should print: hello world.

printf(“%s \n”, my_str1);

}

In: Computer Science

Write a program that accepts user’s section, and display them back with the format “*** Section:...

Write a program that accepts user’s section, and display them back with the format “*** Section: user’s section ***”.

In: Computer Science

Is there any idea that which of the below is true regarding data preparation and integration...

Is there any idea that which of the below is true regarding data preparation and integration thing? 1. Due to data silos exist for the organization and the data must be integrated to reduce data inconsistency often 2. For increasing decision efficiency & data security it must be isolated in separate information systems anyway 3. Actually, vertical data integration enriches existing information and on the other hand horizontal data integration merges tables that hold the same information most of the time. Figure out.

In: Computer Science

public class GroceryCart { private static final int DEFAULT_CAPACITY = 10; /* * Default constructor with...

public class GroceryCart {

private static final int DEFAULT_CAPACITY = 10;

/*

* Default constructor with zero arguments. This constructs a grocery

* cart with a default capacity of ten items.

*/

public GroceryCart() {

}

/*

* Alternate constructor which takes in a maxCapacity. This maxCapacity

* determines how many items can fit inside of this groceryCart.

*/

public GroceryCart(int maxCapacity) {

}

/*

* Adds an item to the grocery cart. Returns true if the item was added

* successfully (i.e. there was still room in the cart to add it.

*/

public boolean addItem(String item, Double cost) {

return false;

}

/*

* Removes the specified item from the cart. Returns true if the item was

* successfully removed (i.e. the item existed in the cart).

*/

public boolean removeItem(String item) {

return false;

}

/*

* Empties the cart of all contents.

*/

public void emptyCart() {

}

/*

* Returns a string representation of the carts contents. The contents

* should be printed out in alphabetical order. It should be of

* the form, "item:price, item:price, item:price". An example:

* "Green Beans:2.99, Milk:41.99, Rolled Oats:1.99, Zucchini:2.67"

*/

public String toString() {

return "";

}

}

In: Computer Science

Select a building. Go to at 3 locations. At each location, record the information in the...

Select a building. Go to at 3 locations. At each location, record the information in the networks window. Also, do a connection and speed test. Write a brief report describing what you learned about Wi-Fi service in the building, referring to the data you collected

In: Computer Science