Write a MIPS assembly language program to solve the following problem: For a set of integers stored in an array, calculate the sum of the even numbers and the sum of the odd numbers. The program should store these numbers in memory variables: evenSum and oddSum. Numbers should be read from the array one at a time with a zero value (0) being used to signal the end of data in the array.
In: Computer Science
In: Computer Science
Q1 If you had 25% more text than could fit on a single page, what measures could you take to ensure all of it fit on one page without really affecting legibility?
Q2As a multimedia project manager, explain how you would handle a situation where both your audio and video specialists suddenly asked for a pay increase in the middle of the project but you did not have the budget for it. Consider also what the consequences of your approach to this problem might be.?
In: Computer Science
A purchase request is initiated when an employee at the company fills in and signs a form on paper. The purchase request includes information about the good to be purchased, the quantity, the desired delivery date, the approximate cost. The employee can also nominate a specific vendor. Employees often request quotes from vendors in order to get the required information. Completing the entire form can take a few days as the requestor often does not have the required data. The quote is attached to the purchase request. This completed request is signed by two supervisors. One supervisor has to provide a financial approval, while the other supervisor has to approve the necessity of the purchase and its conformance with company’s policy (e.g. does a requested software form part of the standard operating environment?). Collecting the signatures from the two supervisors takes on average five days. If it is urgent, the employee can hand-deliver the form, otherwise it is circulated via internal mail. A rejected purchase request is returned to the employee. Some employees make some minor modifications and try in a second attempt other supervisors in order to get approval. Once a purchase request is approved, it is returned to the employee who initiated the purchase requisition. The employee then forwards the form to the Purchasing Department. Many employees make a copy of the form for their own record, in case the form gets lost. The central purchasing Department checks the completeness of the purchase request and returns it to the employee if it is incomplete. Based on attached quotes and other information, the purchasing Department enters the approved purchase request into the company’s Enterprise System. If the employee has not nominated any vendors, a clerk at the purchasing Department will select one based either on the quotes attached to the purchase requisition, or based on the list of vendors (also called Master Vendor List) available in the company’s Enterprise System. Sometimes the initial quote attached to the request has expired in the meantime. In this case, updated quote is requested from the corresponding vendor. In other cases, the vendor who submitted the quote is not recorded in the company’s Enterprise System. In this case, the purchasing Department should give preference to other vendors who are registered in the Enterprise System. If no such vendors are available or if the registered vendors offer higher prices than the one in the submitted quote, the purchasing Department can add the new vendor into the Enterprise System. When a vendor is selected, a purchase order is automatically generated by the Enterprise System. Then, a fax is generated and sent to the vendor.
Create a BPMN model for this process
In: Computer Science
Practice: Look at the following function header:
def foo(a, b, c, d, e)
answer the following questions:
In: Computer Science
1. Create a new class called Card that contains the following attributes: [3 K]
Suit (Clubs, Diamonds, Spades, Hearts)
Value (do not use Jack, Queen, King, Ace, instead, the value of your cards should be 1-13 where 11 = jack, 12 = Queen, 13 = King, and 1 = Ace)
Colour (Red or Black)
2. Make two constructions for your card: [2 A]
A default constructor for when you create an object without any arguments
A constructor that has 3 parameters, one for each attribute
Card should overwrite the corresponding print method to print the card nicely to the user with the following layout (colour does not need to be outputted): [1 K]
Value of Suit
ex. "5 of Hearts"
3. Card should also contain the following methods/functions:
isRed() – returns true or false if the card is Red [1 I]
isLarger(card)– takes in a card and returns the larger card according to the values. Note Ace (1) is smallest card and King (13) is largest. If the cards are the same, return the card the method is called on. [2 I]
copyCard() – creates and returns a new card object with all the same attributes [2 I]
In the main, feel free to test your methods in any way. The test cases will not be affected by any print statements. You must submit before lunch even if all the tests do not pass. Note that commenting is necessary and will count for 2 marks. [2 C]
[4 K, 5I, 2C, 2A]
Code:
Main.java
class Main {
public static void main(String[] args) {
}
}
Card.java
class Card {
}
In: Computer Science
Question 1. The following code asks the user to enter the password and check it with the pre-defined password that stored in the system. If the entered password is correct, it will authenticate the user to log-in into the account, otherwise reject!
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main(void)
{
char buff[8];
bool pass = true ;
printf("\n Enter the password : \n");
gets(buff);
if(strcmp(buff, "admin") ==0)
{
printf ("\n Correct Password \n");
pass = true;
}
else
{
printf ("\n Wrong Password \n");
pass = false;
}
if(pass)
{
/* authorized the user*/
printf ("\n Permission is given to the user \n");
}
return 0;
}
Submission
For this assignment, you need to write a report file of your work. The report should answer each question in details, providing outputs of the code to justify your answer.
In: Computer Science
This class contains the main method. In this class you should:
In: Computer Science
Intro to App Development with Swift by Apple education, Apple Education
ITEC245, iOS App Development
Description: Write a report with your self reflection and learning outcome on below topics:
1. Playground Basics with sample program , Naming and Identifiers with sample program , Strings with sample program , First App with sample program , Functions with sample program
In: Computer Science
Exercise 3.4.1
In P3_4_1.cpp (BELOW), right at the beginning, the program initializes choice to 1. This forces the while loop to run at least once. If you use a do ... while instead, you wouldn't need to initialize the choice. Re-write the below program, call the new program ex341.cpp, so that is uses do ... while. Do not initialize the choice to 1 this time. Compile and run the program.
Answer questions:
Does the program work the same way? Write your answer as a comment inside the code of your ex341.cpp file.
// P3_4_1.cpp - Read and average some integers, print the result.
// This program continue asking for a new number until the user enters a 0 to terminate the program
#include <iostream> using namespace std;
int main(void)
{ int x;
int count = 0; // (1) initialize a counter to 0 to count number of values
int choice = 1; // This is the choice that controls the looping continuation or termination
double sum = 0; // initialize sum to 0 to make sure sum at the beginning is 0
double average;
while( choice == 1) // (2) read N grades and compute their sum, count ensures N entries
{
// read each number and compute the sum:
cout << "\n Enter a grade <Enter>: ";
cin >> x;
sum = sum + x;
count++; // (3) update the count
// prompt the user:
cout << "Do you wish to enter another grade? (1 for yes and 0 or other key for no): "
<< endl;
cin >> choice;
}
if(count == 0)
cout << "You haven't entered any number. No average will be computed. Bye!\n";
else{
average = sum/count; //Notice that we have divided by count this time
cout << "The average of these " << count << " grades is " << average <<"." << endl;
}
return 0;
}
In: Computer Science
Implement a C program that writes and reads as binary data the first 1048576 = 2^20 integer individually to and from a file on HDD.
In: Computer Science
Question 2. The following code defines an array size that sums elements of the defined array through the loop.
#include <stdio.h>
#define A 10
int main(int argc, char** argv) {
int Total = 0;
int numbers[A];
for (int i=0; i < A; i++)
numbers[i] = i+1;
int i =0;
while (i<=A){
Total += numbers[i];
i++;
}
printf("Total =%d\n", Total);
return 0;
}
Submission
For this assignment, you need to write a report file of your work. The report should answer each question in details, providing outputs of the code to justify your answer.
In: Computer Science
“Pick any website that is interesting for you and choose two objects which are there. Write the part of code in how they are implementedFor example, I picked SEU website and I chose (Saudi Electronic University Copyrights) where is in the bottom of the first webpage. This is done by writing <footer> ...</footer> element”
In: Computer Science
Submit:
Be sure to:
Dog Walker Program
Programming language: Python
requirement: please follow up the rules per demonstrated.
In: Computer Science
Suppose we want to define an analogue of the IEEE 754 standard for 14 bits, with 1 bit for sign, 6 bits for (biased) exponent, and 7 bits for the significand. Assume exponent 000000 and 111111 are reserved for 0, denormal, NaN and infinity, just like IEEE 754 standard.
a) What is the bias for the exponent? Express it in decimal.
b) What is the smallest positive denormalized number?
c) What is the smallest positive normalized number?
d) What is the largest positive normalized number (excluding infinity)?
In: Computer Science