Questions
Solve following tasks using MIPS Task Write a program that gets a number from user and...

Solve following tasks using MIPS
Task

Write a program that gets a number from user and displays “Even”, or “Odd. (If-else)


Write a program that input a number from user displays each digit separately. For example if input is 3986, output is  6, 8, 9 ,3. (Loop)


Write a program that converts a decimal number to binary. (Loop)


Hint for Task 1 and Task 3.

    Use, div $tdivident,$tdivider and mfhi $tdestination instructions.

For example,

Div $t1,$t2 will divide $t1 from $t2 and move the quotient to LOW register and remainder to HI        register

mfhi $t3 will move remainder from HIGH register to $t3.

In: Computer Science

Provide a formal proof of the correctness of the algorithm by Boruvka/Solllin for finding a MST.

Provide a formal proof of the correctness of the algorithm by Boruvka/Solllin for finding a MST.

In: Computer Science

true or false C++ a.    (T or F)  There can be no code between a try-block and its...

true or false C++

a.    (T or F)  There can be no code between a try-block and its associated catch-block.

b.    (T or F)  The reserved word throw is used to signal that an exception has occurred.

c.    (T or F)  The correct use of throw can be anywhere in a program; a try /  catch structure is used only in class definitions.

d.    (T or F)  In C++, class is not a reserved word.

e.    (T or F)  Class attributes have no fixed type; their type can be changed during the program execution.


In: Computer Science

In Python, write a program that computes machine epsilon (macheps) in: Single precision (32 bits) and...

In Python, write a program that computes machine epsilon (macheps) in:

Single precision (32 bits) and Double precision (64 bits)

In: Computer Science

Please answer QC,D,E,F using the code provided at the end please. A. Write C code to...

Please answer QC,D,E,F using the code provided at the end please.

A. Write C code to define a structure called date that has three fields day, month, year, all of which are ints.

B. Write C code to define a structure called person that has fields for name (50 char array), dateOfBirth (date struct from Q1), address (200 char array), phoneNum (20 char array), and ID (int).

C. Write a C program that uses the person structure from Q2, and declares a variable of this type. Your program should then read information from the keyboard to fill one of these structures with information. Use fgets to read entire lines of text for the name and address rather than scanf.

D. Create another variable that is a pointer to the person structure defined in Q2. Set this variable to point at the variable declared in Q3, and then use the pointer to print the structure to the screen (with appropriate text).

E. Show how a typedef statement can be used to declare a new data type – to demonstrate this create a new type called Person which is the structure declared previously.

F. . Write C code to declare an array of 50 pointers to Persons. Using a loop, use malloc to dynamically allocate memory for each of these structures. There is no need to put any values into the structures. Use a second loop to then deallocate each structure.

__________________________________________________________________________________________________________________________

#include<stdio.h>

#include<stdlib.h>

#define NAME_SIZE 50

#define address_SIZE 200

#define phone_SIZE 20

// Part A defining the structure

struct Date{

int day, month, year;

};

// Part B defining the Person structure

struct Person{

char name[NAME_SIZE];

struct Date dateOfBirth;

char address[address_SIZE];

int id;

char phoneNumber[phone_SIZE];

};

// Main function for the same

int main(){

// part C defining the variable for the use of above structure

struct Person p;

// Just to make the inputs go flowlessly

char newLine;

// Taking the user input

printf("Enter the person name: ");

fgets(p.name, NAME_SIZE, stdin);

printf("Enter dob in 'day month year' Format");

scanf("%d%d%d", &p.dateOfBirth.day, &p.dateOfBirth.month, &p.dateOfBirth.year);

scanf("%c", &newLine);

printf("Enter the address: ");

fgets(p.address, address_SIZE, stdin);

printf("Enter the id: ");

scanf("%d", &p.id);

scanf("%c", &newLine);

printf("Enter the phone number: ");

fgets(p.phoneNumber, phone_SIZE, stdin);

// part D defining the pointer for the person

struct Person* p2;

p2 = &p;

// Printing the Scanned values

printf("Printing the populated Person Structure\n");

printf("Name: %s\n", p2->name);

printf("DOB: %d %d %d\n", p2->dateOfBirth.day, p2->dateOfBirth.month, p2->dateOfBirth.year);

printf("Address: %s\n", p2->address);

printf("Id: %d\n", p2->id);

printf("Phone: %s\n", p2->phoneNumber);

In: Computer Science

Write a program that prompts the user for the length of one side of a triangle...

Write a program that prompts the user for the length of one side of a triangle and the sizes of the two adjacent angles in degrees and then displays the length of the two other sides and the size of the third angle.

In: Computer Science

implement a formula of your own choosing, as a Python function, following these instructions: You need...

implement a formula of your own choosing, as a Python function, following these instructions:

  • You need to write a function that takes multiple arguments (not input from the keyboard!), and that returns the result of a formula of your choosing (not printing the output on the screen!).
  • For your function definition, choose a formula from mathematics, science, or a related field.
  • Then, in the main part of the script, write the main Python code (outside of any function) that asks the user to input the appropriate values, then uses the function you just defined to do a calculation, and then outputs the result.
  • Make sure that the user of the script knows what they are expected to input, what the script is going to calculate, and what the output means. (Remember that units are important!)
  • Don't pick a formula that is too simple; make sure that it's got at least two variables, and that it uses more than one operation (so don't pick a formula such as the volume of a 'box' isVolume = length * width * height,

In: Computer Science

4 function calculator (op1 oper op2) using scheme language also include comments

4 function calculator (op1 oper op2) using scheme language

also include comments

In: Computer Science

C# Language Create a class called evaluateValue that declares 3 integer class variables: zeroValue, positiveValue and...

C# Language

  • Create a class called evaluateValue that declares 3 integer class variables: zeroValue, positiveValue and negativeValue. These should be declared as public and you should not use automatic properties to declare them.
  • Your class should have a constructor that takes one integer argument. In the constructor you will code if statements to set one of the three class variables (indicators) to 1 if the number sent to the constructor is either equal to zero, negative, or positive.
  • In the class provide a method printit() used to print the results
    • Evaluate the positive, negative, and zero indicator to determine which line to print. If the indicator is set to 1 then the indicator is true.
    • You will print one of three statements;
      • The number was zero.
      • The number was positive.
      • The number was negative.
  • In the default wrapper class named assignment3 and containing Main write the code in Main that declares one integer variable: val1.
  • Use Console Write and Readline and the convert method to take the integer entry from the keyboard and pass it to the evaluateValue constructor.
  • Instantiate an evaluateValue object and pass the integer values to the constructor.
  • From Main call the printit method which will print the resulting evaluation in the class object.

In: Computer Science

Pyramid of oranges, 2^x in each row, total for n rows using scheme language also include...

Pyramid of oranges, 2^x in each row, total for n rows using scheme language also include comments

In: Computer Science

The following task does not involve writing program code: instead, you will be writing function signatures...

The following task does not involve writing program code: instead, you will be writing function signatures for hypothetical functions (you will be defining functions in subsequent tasks).

  1. For this task, you are presented with several 'hypothetical' functions. These aren't built-in Python functions: they are functions that you will have to define (i.e. implement, write) yourself later. however, you only need to write a signature for each hypothetical function listed here:
    1. toThePower(): takes two numbers e.g. x and y , and returns the value of (x to the power y). For example, toThePower(3,3) returns 27, and toThePower(-0.1,3) returns -0.001.
    2. quadruplicate(): takes a string, and returns a string consisting of three copies of that string concatenated together. For example, quadruplicate("na") returns "nananana", and quadruplicate("..?") returns "..?..?..?..?".
    3. subtract(): takes two numbers, and returns the difference between them. For example, subtract(10,3) returns 7, and subtract(2.2,5) returns -2.8.
    4. overlap(): We are not going to tell you exactly what it does, but we will give you a few examples: overlap("banana","analyze") returns 3 (not 4), overlap("abracadabra","abraham") returns 4 (not 5), overlap("foobar","red") returns 1, and overlap("foobar","bazinga") returns 0.
    5. multiplicate(): We are not going to tell you exactly what it does, but we will give you a few examples: multiplicate("x",5) returns "xxxxx", multiplicate("goo",3) returns "googoogoo", and multiplicate("never",0) returns "" (the empty string).

In: Computer Science

Design an EER diagram for Motor, Inc.: Motor, Inc. is a car dealer that sells both...

  1. Design an EER diagram for Motor, Inc.:

Motor, Inc. is a car dealer that sells both new cars and second-hand cars. You are the technical consultant of Motor Inc. and are currently helping the company to develop a database system. Your job is to draw an ERD to help them design the database.

  • A car has a unique car ID, selling price, make, model, year, color, and car type (used to indicate a car is new or used).
  • Motor Inc. has approximately 100 employees. An employee has an employee ID, job title, gender, salary, list of certifications, date of birth, and age. If an employee is currently married to another employee of Motor Inc., the date of marriage and who is married to whom must be stored; however, no record of marriage is required if an employee’s spouse is not an employee. An employee can handle none to multiple cars depending on his/her job title. A car can be handled by one to at most three employees.
  • There are seven branches at this company, and each of which has a unique name. Each branch is located at different addresses, which contains information such as street, city, state, and zip code. Besides that, each branch has its own email address, and three phone numbers. Each branch has many employees. If there are less than three employees, the branch would be closed. An employee must belong to one and only one branch. Moreover, some employees are the branch heads for these branches. Each branch only needs one branch head, but an employee can manage multiple branches.
  • The company also wants to track its customers’ information. A customer must provide SSN when registered with the company. The company would typically ask a customer to report their household income, and occupation. A customer can visit none or multiple branches, and a branch can be visited by none to multiple customers.

In: Computer Science

1. Describe four cloud-specific security threats. 2. Are there any advantages in not including the MAC...

1. Describe four cloud-specific security threats.

2. Are there any advantages in not including the MAC in the scope of the packet encryption in SSH?

In: Computer Science

2 newer techinques of stream ciphers

2 newer techinques of stream ciphers

In: Computer Science

JAVA StudentId: Consist of the first two characters of the student's first name, student's birth year,...

JAVA

StudentId: Consist of the first two characters of the student's first name, student's birth year, and the last two characters of the last name. For instance, if the student full name is John Doe and birthyear is 1995, then the id will be Jo1995oe. Birthday is using GregorianCalendar.

String firstname

String lastname

GregorianCalendar birthday

In: Computer Science