Answer:
Check the explanation
Explanation:
Let the population mean time on task of original website be [tex]\mu_1[/tex] and that of new prototype be [tex]\mu_2[/tex]
Here we are to test
[tex]H_0:\mu_1=\mu_2\;\;against\;\;H_1:\mu_1<\mu_2[/tex]
The data are summarized as follows:
Sample 1 Sample 2
Sample size n=20 n=20
Sample mean [tex]\bar{x}_1=243.4[/tex] [tex]\bar{x}_2=253.4[/tex]
Sample SD s1=130.8901 s2=124.8199
The test statistic is obtained from online calculator as
t=-0.23
The p-value is given by 0.821
As the p-value is more than 0.05, we fail to reject the null hypothesis at 5% level of significance and hence conclude that there is no statistically significant difference between the original website and the prototype developed by the team at 5% level of significance.
Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.
import java.util.Scanner; public class RecursiveCalls { public static void backwardsAlphabet(char currLetter) { if (currLetter == 'a') { System.out.println(currLetter); } else { System.out.print(currLetter + " "); backwardsAlphabet((char)(currLetter - 1)); } } public static void main (String [] args) { Scanner scnr = new Scanner(System.in); char startingLetter; startingLetter = scnr.next().charAt(0); /* Your solution goes here */ } }
Answer:
Following are the code to method calling
backwardsAlphabet(startingLetter); //calling method backwardsAlphabet
Output:
please find the attachment.
Explanation:
Working of program:
In the given java code, a class "RecursiveCalls" is declared, inside the class, a method that is "backwardsAlphabet" is defined, this method accepts a char parameter that is "currLetter". In this method a conditional statement is used, if the block it will check input parameter value is 'a', then it will print value, otherwise, it will go to else section in this block it will use the recursive function that prints it's before value. In the main method, first, we create the scanner class object then defined a char variable "startingLetter", in this we input from the user and pass its value into the method that is "backwardsAlphabet".Explain possible ways that Darla can communicate with her coworker Terry, or her manager to make sure Joe receives great customer service?
Answer:
They can communicate over the phone or have meetings describing what is and isn't working for Joe. It's also very important that Darla makes eye contact and is actively listening to effectively handle their customer.
Explanation:
Write a functionvector merge(vector a, vector b)that merges two vectors, alternating elements from both vectors. If one vector isshorter than the other, then alternate as long as you can and then append the remaining elements from the longer vector. For example, if a is 1 4 9 16and b is9 7 4 9 11then merge returns the vector1 9 4 7 9 4 16 9 1118. Write a predicate function bool same_elements(vector a, vector b)that checks whether two vectors have the same elements in some order, with the same multiplicities. For example, 1 4 9 16 9 7 4 9 11 and 11 1 4 9 16 9 7 4 9 would be considered identical, but1 4 9 16 9 7 4 9 11 and 11 11 7 9 16 4 1 would not. You will probably need one or more helper functions.19. What is the difference between the size and capacity of a vector
Answer:
see explaination for code
Explanation:
CODE
#include <iostream>
#include <vector>
using namespace std;
vector<int> merge(vector<int> a, vector<int> b) {
vector<int> result;
int k = 0;
int i = 0, j = 0;
while (i < a.size() && j < b.size()) {
if (k % 2 == 0) {
result.push_back(a[i ++]);
} else {
result.push_back(b[j ++]);
}
k ++;
}
while (i < a.size()) {
result.push_back(a[i ++]);
}
while(j < b.size()) {
result.push_back(b[j ++]);
}
return result;
}
int main() {
vector<int> a{1, 4, 9, 16};
vector<int> b{9, 7, 4, 9, 11};
vector<int> result = merge(a, b);
for (int i=0; i<result.size(); i++) {
cout << result[i] << " ";
}
}
(34+65+53+25+74+26+41+74+86+24+875+4+23+5432+453+6+42+43+21)°
Write a program that maintains a database containing data, such as name and birthday, about your friends and relatives. You should be able to enter, remove, modify, or search this data. Initially, you can assume that the names are unique. The program should be able to save the data in a fi le for use later. Design a class to represent the database and another class to represent the people. Use a binary search tree of people as a data member of the database class. You can enhance this problem by adding an operation that lists everyone who satisfi es a given criterion. For example, you could list people born in a given month. You should also be able to list everyone in the database.
Answer:
[tex]5909? \times \frac{?}{?} 10100010 {?}^{?} 00010.222 {?}^{2} [/tex]
In this question, we give two implementations for the function: def intersection_list(lst1, lst2) This function is given two lists of integers lst1 and lst2. When called, it will create and return a list containing all the elements that appear in both lists. For example, the call: intersection_list([3, 9, 2, 7, 1], [4, 1, 8, 2])could create and return the list [2, 1]. Note: You may assume that each list does not contain duplicate items. a) Give an implementation for intersection_list with the best worst-case runtime. b) Give an implementation for intersection_list with the best average-case runtime.
Answer:
see explaination
Explanation:
a)Worst Case-time complexity=O(n)
def intersection_list(lst1, lst2):
lst3 = [value for value in lst1 if value in lst2]
return lst3
lst1 = []
lst2 = []
n1 = int(input("Enter number of elements for list1 : "))
for i in range(0, n1):
ele = int(input())
lst1.append(ele) # adding the element
n2 = int(input("Enter number of elements for list2 : "))
for i in range(0, n2):
ele = int(input())
lst2.append(ele) # adding the element
print(intersection_list(lst1, lst2))
b)Average case-time complexity=O(min(len(lst1), len(lst2))
def intersection_list(lst1, lst2):
return list(set(lst1) & set(lst2))
lst1 = []
lst2 = []
n1 = int(input("Enter number of elements for list1 : "))
for i in range(0, n1):
ele = int(input())
lst1.append(ele)
n2 = int(input("Enter number of elements for list2 : "))
for i in range(0, n2):
ele = int(input())
lst2.append(ele)
print(intersection_list(lst1, lst2))
The Taylor series expansion for ax is: Write a MATLAB program that determines ax using the Taylor series expansion. The program asks the user to type a value for x. Use a loop for adding the terms of the Taylor series. If cn is the nth term in the series, then the sum Sn of the n terms is . In each pass calculate the estimated error E given by . Stop adding terms when . The program displays the value of ax. Use the program to calculate: (a) 23.5 (b) 6.31.7 Compare the values with those obtained by using a calculator.
Answer: (a). 11.3137
(b). 22.849
Explanation:
Provided below is a step by step analysis to solving this problem
(a)
clc;close all;clear all;
a=2;x=3.5;
E=10;n=0;k=1;sn1=0;
while E >0.000001
cn=((log(a))^n)*(x^n)/factorial(n);
sn=sn1+cn;
E=abs((sn-sn1)/sn1);
sn1=sn;
n=n+1;
k=k+1;
end
fprintf('2^3.5 from tailor series=%6.4f after adding n=%d terms\n',sn,n);
2^3.5 from tailor series=11.3137 after adding n=15 terms
disp('2^3.5 using calculator =11.3137085');
Command window:
2^3.5 from tailor series=11.3137 after adding n=15 terms
2^3.5 using calculator =11.3137085
(b)
clc;close all;clear all;
a=6.3;x=1.7;
E=10;n=0;k=1;sn1=0;
while E >0.000001
cn=((log(a))^n)*(x^n)/factorial(n);
sn=sn1+cn;
E=abs((sn-sn1)/sn1);
sn1=sn;
n=n+1;
k=k+1;
end
fprintf('6.3^1.7 from tailor series=%6.4f after adding n=%d terms\n',sn,n);
disp('6.3^1.7 using calculator =22.84961748');
Command window:
6.3^1.7 from tailor series=22.8496 after adding n=16 terms
6.3^1.7 using calculator =22.84961748
cheers i hope this helped !!!
Select the correct navigational path to create the function syntax to use the IF function.
Click the Formula tab on the ribbon and look in the ???
'gallery
Select the range of cells.
Then, begin the formula with the ????? click ?????. and click OK.
Add the arguments into the boxes for Logical Test, Value_if_True, and Value_if_False.
Answer:
1. Logical
2.=
3.IF
Explanation:
just did the assignment
How has the Aswan High Dem had an adverse effect on human health?
Answer:
How was the Aswan high dam had an adverse effect on human health? It created new ecosystems in which diseases such as malaria flourished. An environmental challenge facing the Great Man Made River is that pumping water near the coast. ... Water scarcity makes it impossible to grow enough food for the population.
Explanation:
Dave owns a construction business and is in the process of buying a laptop. He is looking for a laptop with a hard drive that will likely continue to function if the computer is dropped. Which type of hard drive does he need?
Answer:
Solid state drive
Explanation:
The term solid-state drive is used for the electronic circuitry made entirely from semiconductors. This highlights the fact that the main storage form, in terms of a solid-state drive, is via semiconductors instead of a magnetic media for example a hard disk. In lieu of a more conventional hard drive, SSD is built to live inside the device. SSDs are usually more resistant to physical shock in comparison to the electro-mechanical drives and it functions quietly and has faster response time. Therefore, SSD will be best suitable for the Dave.
The cord of a bow string drill was used for
a. holding the cutting tool.
b. providing power for rotation.
c. transportation of the drill.
d. finding the center of the hole.
Answer:
I don't remember much on this stuff but I think it was B
You work at a cheeseburger restaurant. Write a program that determines appropriate changes to a food order based on the user’s dietary restrictions. Prompt the user for their dietary restrictions: vegetarian, lactose intolerant, or none. Then using if statements and else statements, print the cook a message describing how they should modify the order. The following messages should be used: - If the user enters "lactose intolerant", say "No cheese." - If the user enters "vegetarian", say "Veggie burger." - If the user enters "none", say "No alterations."
Answer:
See explaination
Explanation:
dietary_restrictions = input("Any dietary restrictions?: ")
if dietary_restrictions=="lactose intolerant":
print("No cheese")
elif dietary_restrictions == "vegetarian":
print("Veggie burger")
else:
print("No alteration")
*Sometimes it is difficult to convince top management to commit funds to develop and implement a SIS why*
Step-by-step Explanation:
SIS stands for: The Student Information System (SIS).
This system (a secure, web-based accessible by students, parents and staff) supports all aspects of a student’s educational experience, and other information. Examples are academic programs, test grades, health information, scheduling, etc.
It is difficult to convince top management to commit funds to develop and implement SIS, this can be due to a thousand reasons.
The obvious is that the management don't see the need for it. They would rather have students go through the educational process the same way they did. Perhaps, they just don't trust the whole process, they feel more in-charge while using a manual process.
Design an application for Bob's E-Z Loans. The application accepts a client's loan amount and monthly payment amount. Output the customer's loan balance each month until the loan is paid off. b. Modify the Bob's E-Z Loans application so that after the payment is made each month, a finance charge of 1 percent is added to the balance.
Answer:
part (a).
The program in cpp is given below.
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
//variables to hold balance and monthly payment amounts
double balance;
double payment;
//user enters balance and monthly payment amounts
std::cout << "Welcome to Bob's E-Z Loans application!" << std::endl;
std::cout << "Enter the balance amount: ";
cin>>balance;
std::cout << "Enter the monthly payment: ";
cin>>payment;
std::cout << "Loan balance: " <<" "<< "Monthly payment: "<< std::endl;
//balance amount and monthly payment computed
while(balance>0)
{
if(balance<payment)
{ payment = balance;}
else
{
std::cout << balance <<"\t\t\t"<< payment << std::endl;
balance = balance - payment;
}
}
return 0;
}
part (b).
The modified program from part (a), is given below.
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
//variables to hold balance and monthly payment amounts
double balance;
double payment;
double charge=0.01;
//user enters balance and monthly payment amounts
std::cout << "Welcome to Bob's E-Z Loans application!" << std::endl;
std::cout << "Enter the balance amount: ";
cin>>balance;
std::cout << "Enter the monthly payment: ";
cin>>payment;
balance = balance +( balance*charge );
std::cout << "Loan balance with 1% finance charge: " <<" "<< "Monthly payment: "<< std::endl;
//balance amount and monthly payment computed
while(balance>payment)
{
std::cout << balance <<"\t\t\t\t\t"<< payment << std::endl;
balance = balance +( balance*charge );
balance = balance - payment;
}
if(balance<payment)
{ payment = balance;}
std::cout << balance <<"\t\t\t\t\t"<< payment << std::endl;
return 0;
}
Explanation:
1. The variables to hold the loan balance and the monthly payment are declared as double.
2. The program asks the user to enter the loan balance and monthly payment respectively which are stored in the declared variables.
3. Inside a while loop, the loan balance and monthly payment for each month is computed with and without finance charges in part (a) and part (b) respectively.
4. The computed values are displayed for each month till the loan balance becomes zero.
5. The output for both part (a) and part (b) are attached as images.
Create a program that generates a report that displays a list of students, classes they are enrolled in and the professor who teaches that class. There are 3 files that provide the input data: 1. FinalRoster.txt : List of students and professors ( S: student, P: professor) Student row: S,Student Name, StudentID Professor row: P, Professor Name, Professor ID, Highest Education 2. FinalClassList.txt: List of classes and professor who teach them (ClassID, ClassName, ID of Professor who teach that class) 3. FinalStudentClassList.txt: List of classes the students are enrolled in. (StudentID, ClassID) The output shall be displayed on screen and stored in a file in the format described in FinalOutput.txt You will need to apply all course concepts in your solution. 1. Student and Professor should be derived from a super class "Person" 2. Every class should implement toString method to return data in the format required for output 3. Exception handling (e.g. FileNotFound etc.) must be implemented 4. Source code must be documented in JavaDoc format 5. Do not hard code number of students, professors or classes. Submit source Java files, the output file and screenshot of the output in a zip format
Answer:
All the classes are mentioned with code and screenshots. . That class is shown at last.
Explanation:
Solution
Class.Java:
Code
**
* atauthor your_name
* This class denotes Class at the college.
*
*/
public class Class {
private String className,classID;
private Professor professor;
/**
* atparam className
* atparam classID
* atparam professor
*/
public Class(String className, String classID, Professor professor) {
this.classID=classID;
this.className=className;
this.professor=professor;
}
/**
* at return classID of the class
*/
public String getClassID() {
return classID;
}
/**
* Override toString() from Object Class
*/
public String toString() {
return classID+" "+className+" "+professor.getName()+" "+professor.getEducation();
}
}
Person.Java:
Code:
/**
* atauthor your_name
* This class represents Person
*
*/
public class Person {
protected String name;
/**method to fetch name
* at return
*/
public String getName() {
return name;
}
/**method to set name
* at param name
*/
public void setName(String name) {
this.name = name;
}
Professor.java:
Code:
import java.util.ArrayList;
import java.util.List;
/**
* at author your_name
*
*This class represents professors
*
*/
public class Professor extends Person{
private String professorID, education;
private List<Class> classes=new ArrayList<Class>();
/**
* at param name
* at param professorID
* at param education
*/
public Professor(String name,String professorID,String education) {
this.name=name;
this.professorID=professorID;
this.education=education;
}
/**
* at return
*/
public String getEducation() {
return this.education;
}
/**
* at return
*/
public String getprofessorID() {
return this.professorID;
}
/** to add classes
* at param Class
*/
public void addClass(Class c) {
classes.add(c);
}
/**
* Override toString() from Object Class
*/
public String toString() {
String result=this.getName()+" - "+professorID+" - "+education;
for(Class c:classes) {
result+=c.toString()+"\n";
}
return result;
}
}
}
Student.java:
Code:
import java.util.ArrayList;
import java.util.List;
/**
* This class represents students
* at author your_Name
*
*/
public class Student extends Person{
private String studentID;
private List<Class> classes=new ArrayList<Class>();
/**
* atparam name
* atparam studentID
*/
public Student(String name,String studentID) {
this.name=name;
this.studentID=studentID;
}
/**
* atreturn
*/
public String getStudentID() {
return studentID;
}
/**
* atparam c
*/
public void addClass(Class c) {
classes.add(c);
}
/**
* atreturn
*/
public int getClassCount() {
return classes.size();
}
/**
* Override toString() from Object Class
*/
public String toString() {
String result=this.getName()+" - "+studentID+"\n";
for(Class c:classes) {
result+=c.toString()+"\n";
}
return result;
}
}
NOTE: Kindly find an attached copy of screenshot of the output, which is a part of the solution to this question
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string.
Ex: If the input is:
n Monday
the output is:
1
Ex: If the input is:
z Today is Monday
the output is:
0
Ex: If the input is:
n It's a sunny day
the output is:
2
Case matters.
Ex: If the input is:
n Nobody
the output is:
0
n is different than N.
This is what i have so far.
#include
#include
using namespace std;
int main() {
char userInput;
string userStr;
int numCount;
cin >> userInput;
cin >> userStr;
while (numCount == 0) {
cout << numCount << endl;
numCount = userStr.find(userInput);
}
return 0;
}
Retail price data for n = 60 hard disk drives were recently reported in a computer magazine. Three variables were recorded for each hard disk drive: y = Retail PRICE (measured in dollars) x1 = Microprocessor SPEED (measured in megahertz) (Values in sample range from 10 to 40) x2 = CHIP size (measured in computer processing units) (Values in sample range from 286 to 486) A first-order regression model was fit to the data. Part of the printout follows: __________.
Answer:
Explanation:
Base on the scenario been described in the question, We are 95% confident that the price of a single hard drive with 33 megahertz speed and 386 CPU falls between $3,943 and $4,987
To encrypt messages I propose the formula C = (3P + 1) mod 27, where P is the "plain text" (the original letter value) and C is the "cipher text" (the encrypted letter value). For example, if P = 2 (the letter 'c' ), C would be 7 (the letter 'h') since (3(2) + 1) mod 27 = 7. There is a problem though: When I send the message 'c' to my friend, encrypted as 'h', they don't know whether the original message was 'c' or another letter that also encrypts to 'h'. What other letter(s) would also encrypt to 'h' besides 'c' in this system?
Answer:
C = (3P+1) % 27
so when P will be max 26,when P is 26 the (3P+1) = 79. And 79/27 = 2 so let's give name n = 2.
Now doing reverse process
We get ,
P = ((27*n)+C-1)/3
Where n can be 0,1,2
So substituting value of n one by one and the C=7(corresponding index of h)
For n= 0,we get P=2, corresponding char is 'c'
For n=1,we get P=11, corresponding char is 'l'
For n=2,we get P= 20, corresponding cahr is 'u'.
So beside 'c',the system will generate 'h' for 'l' and 'u' also.
Create a macro named mReadInt that reads a 16- or 32-bit signed integer from standard input and returns the value in an argument. Use conditional operators to allow the macro to adapt to the size of the desired result. Write a program that tests the macro, passing it operands of various sizes.
Answer:
;Macro mReadInt definition, which take two parameters
;one is the variable to save the number and other is the length
;of the number to read (2 for 16 bit and 4 for 32 bit) .
%macro mReadInt 2
mov eax,%2
cmp eax, "4"
je read2
cmp eax, "2"
je read1
read1:
mReadInt16 %1
cmp eax, "2"
je exitm
read2:
mReadInt32 %1
exitm:
xor eax, eax
%endmacro
;macro to read the 16 bit number, parameter is number variable
%macro mReadInt16 1
mov eax, 3
mov ebx, 2
mov ecx, %1
mov edx, 5
int 80h
%endmacro
;macro to read the 32 bit number, parameter is number variable
%macro mReadInt32 1
mov eax, 3
mov ebx, 2
mov ecx, %1
mov edx, 5
int 80h
%endmacro
;program to test the macro.
;data section, defining the user messages and lenths
section .data
userMsg db 'Please enter the 32 bit number: '
lenUserMsg equ $-userMsg
userMsg1 db 'Please enter the 16 bit number: '
lenUserMsg1 equ $-userMsg1
dispMsg db 'You have entered: '
lenDispMsg equ $-dispMsg
;.bss section to declare variables
section .bss
;num to read 32 bit number and num1 to rad 16-bit number
num resb 5
num1 resb 3
;.text section
section .text
;program start instruction
global _start
_start:
;Displaying the message to enter 32bit number
mov eax, 4
mov ebx, 1
mov ecx, userMsg
mov edx, lenUserMsg
int 80h
;calling the micro to read the number
mReadInt num, 4
;Printing the display message
mov eax, 4
mov ebx, 1
mov ecx, dispMsg
mov edx, lenDispMsg
int 80h
;Printing the 32-bit number
mov eax, 4
mov ebx, 1
mov ecx, num
mov edx, 4
int 80h
;displaying message to enter the 16 bit number
mov eax, 4
mov ebx, 1
mov ecx, userMsg1
mov edx, lenUserMsg1
int 80h
;macro call to read 16 bit number and to assign that number to num1
;mReadInt num1,2
;calling the display mesage function
mov eax, 4
mov ebx, 1
mov ecx, dispMsg
mov edx, lenDispMsg
int 80h
;Displaying the 16-bit number
mov eax, 4
mov ebx, 1
mov ecx, num1
mov edx, 2
int 80h
;exit from the loop
mov eax, 1
mov ebx, 0
int 80h
Explanation:
For an assembly code/language that has the conditions given in the question, the program that tests the macro, passing it operands of various sizes is given below;
;Macro mReadInt definition, which take two parameters
;one is the variable to save the number and other is the length
;of the number to read (2 for 16 bit and 4 for 32 bit) .
%macro mReadInt 2
mov eax,%2
cmp eax, "4"
je read2
cmp eax, "2"
je read1
read1:
mReadInt16 %1
cmp eax, "2"
je exitm
read2:
mReadInt32 %1
exitm:
xor eax, eax
%endmacro
;macro to read the 16 bit number, parameter is number variable
%macro mReadInt16 1
mov eax, 3
mov ebx, 2
mov ecx, %1
mov edx, 5
int 80h
%endmacro
;macro to read the 32 bit number, parameter is number variable
%macro mReadInt32 1
mov eax, 3
mov ebx, 2
mov ecx, %1
mov edx, 5
int 80h
%endmacro
;program to test the macro.
;data section, defining the user messages and lenths
section .data
userMsg db 'Please enter the 32 bit number: '
lenUserMsg equ $-userMsg
userMsg1 db 'Please enter the 16 bit number: '
lenUserMsg1 equ $-userMsg1
dispMsg db 'You have entered: '
lenDispMsg equ $-dispMsg
;.bss section to declare variables
section .bss
;num to read 32 bit number and num1 to rad 16-bit number
num resb 5
num1 resb 3
;.text section
section .text
;program start instruction
global _start
_start:
;Displaying the message to enter 32bit number
mov eax, 4
mov ebx, 1
mov ecx, userMsg
mov edx, lenUserMsg
int 80h
;calling the micro to read the number
mReadInt num, 4
;Printing the display message
mov eax, 4
mov ebx, 1
mov ecx, dispMsg
mov edx, lenDispMsg
int 80h
;Printing the 32-bit number
mov eax, 4
mov ebx, 1
mov ecx, num
mov edx, 4
int 80h
;displaying message to enter the 16 bit number
mov eax, 4
mov ebx, 1
mov ecx, userMsg1
mov edx, lenUserMsg1
int 80h
;macro call to read 16 bit number and to assign that number to num1
;mReadInt num1,2
;calling the display mesage function
mov eax, 4
mov ebx, 1
mov ecx, dispMsg
mov edx, lenDispMsg
int 80h
;Displaying the 16-bit number
mov eax, 4
mov ebx, 1
mov ecx, num1
mov edx, 2
int 80h
;exit from the loop
mov eax, 1
mov ebx, 0
int 80h
Donnell backed up the information on his computer every week on a flash drive. Before copying the files to the flash drive, he always ran a virus scan against the files to ensure that no viruses were being copied to the flash drive. He bought a new computer and inserted the flash drive so that he could transfer his files onto the new computer. He got a message on the new computer that the flash drive was corrupted and unreadable; the information on the flash drive cannot be retrieved. Assuming that the flash drive is not carrying a virus, which of the following does this situation reflect?
a. Compromise of the security of the information on the flash drive
b. Risk of a potential breach in the integrity of the data on the flash drive
c. Both of the above
d. Neither of the above.
Answer:
b. Risk of a potential breach in the integrity of the data on the flash drive
Explanation:
The corrupted or unreadable file error is an error message generated if you are unable to access the external hard drive connected to the system through the USB port. This error indicates that the files on the external hard drive are no longer accessible and cannot be opened.
There are several reasons that this error message can appear:
Viruses and Malware affecting the external hard drive .Physical damage to external hard drive or USB memory .Improper ejection of removable drives.Who is your favorite smite god in Hi-Rez’s “Smite”
Answer:
Variety
Explanation:
(TCO 4) Give the contents of Register A after the execution of the following instructions:
Data_1 EQU $12
Data_2 EQU %01010101
LDAA #Data_1
ADDA #Data_2
A) $12
B) $67
C) $55
D) $57
Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes
Answer:.
// Program is written in C++.
// Comments are used for explanatory purposes
// Program starts here..
#include<iostream>
using namespace std;
int main()
{
// Declare Variables
int amount, dollar, quarter, dime, nickel, penny;
// Prompt user for input
cout<<"Amount: ";
cin>>amount;
// Check if input is less than 1
if(amount<=0)
{
cout<<"No Change";
}
else
{
// Convert amount to various coins
dollar = amount/100;
amount = amount%100;
quarter = amount/25;
amount = amount%25;
dime = amount/10;
amount = amount%10;
nickel = amount/5;
penny = amount%5;
// Print results
if(dollar>=1)
{
if(dollar == 1)
{
cout<<dollar<<" dollar\n";
}
else
{
cout<<dollar<<" dollars\n";
}
}
if(quarter>=1)
{
if(quarter== 1)
{
cout<<quarter<<" quarter\n";
}
else
{
cout<<quarter<<" quarters\n";
}
}
if(dime>=1)
{
if(dime == 1)
{
cout<<dime<<" dime\n";
}
else
{
cout<<dime<<" dimes\n";
}
}
if(nickel>=1)
{
if(nickel == 1)
{
cout<<nickel<<" nickel\n";
}
else
{
cout<<nickel<<" nickels\n";
}
}
if(penny>=1)
{
if(penny == 1)
{
cout<<penny<<" penny\n";
}
else
{
cout<<penny<<" pennies\n";
}
}
}
return 0;
}
Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bits memory address references given as word addresses. 0x03, 0xb4, 0x2b, 0x02, 0xbf, 0x58, 0xbe, 0x0e, 0xb5, 0x2c, 0xba, 0xfd For each of these references identify the binary word address, the tag, and the index given a direct mapped cache with 16 one-word blocks. Also list whether each reference is a hit or a miss, assuming the cache is initially empty.
Answer:
See explaination
Explanation:
please kindly see attachment for the step by step solution of the given problem.
Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600 MHz. Computer B has a CPI of 2.5 and can be run at a clock rate of 750 MHz. We have a particular program we wish to run. When compiled for computer A, this program has exactly 100,000 instructions. How many instructions would the program need to have when compiled for Computer B, in order for the two computers to have exactly the same execution time for this program
Answer:
Check the explanation
Explanation:
CPI means Clock cycle per Instruction
given Clock rate 600 MHz then clock time is Cー 1.67nSec clockrate 600M
Execution time is given by following Formula.
Execution Time(CPU time) = CPI*Instruction Count * clock time = [tex]\frac{CPI*Instruction Count}{ClockRate}[/tex]
a)
for system A CPU time is 1.3 * 100, 000 600 106
= 216.67 micro sec.
b)
for system B CPU time is [tex]=\frac{2.5*100,000}{750*10^6}[/tex]
= 333.33 micro sec
c) Since the system B is slower than system A, So the system A executes the given program in less time
Hence take CPU execution time of system B as CPU time of System A.
therefore
216.67 micro = =[tex]\frac{2.5*Instruction}{750*10^6}[/tex]
Instructions = 216.67*750/2.5
= 65001
hence 65001 instruction are needed for executing program By system B. to complete the program as fast as system A
The number of instructions that the program would need to have when compiled for Computer B is; 65000 instructions
What is the execution time?
Formula for Execution time is;
Execution time = (CPI × Instruction Count)/Clock Time
We are given;
CPI for computer A = 1.3
Instruction Count = 100000
Clock time = 600 MHz = 600 × 10⁶ Hz
Thus;
Execution time = (1.3 * 100000)/(600 × 10⁶)
Execution time(CPU Time) = 216.67 * 10⁻⁶ second
For CPU B;
CPU Time = (2.5 * 100000)/(750 × 10⁶)
CPU Time = 333.33 * 10⁻⁶ seconds
Thus, instructions for computer B for the two computers to have same execution time is;
216.67 * 10⁻⁶ = (2.5 * I)/(750 × 10⁶)
I = (216.67 * 10⁻⁶ * 750 × 10⁶)/2.5
I = 65000 instructions
Read more about programming instructions at; https://brainly.com/question/15683939
Which of the following should be the first page of a report?
O Title page
Introduction
O Table of contents
Terms of reference
Answer:
Title page should be the first page of a report.
hope it helps!
The Monte Carlo (MC) Method (Monte Carlo Simulation) was first published in 1949 by Nicholas Metropolis and Stanislaw Ulam in the work "The Monte Carlo Method" in the Journal of American Statistics Association. The name Monte Carlo has its origins in the fact that Ulam had an uncle who regularly gambled at the Monte Carlo casino in Monaco. In fact, way before 1949 the method had already been extensively used as a secret project of the U.S. Defense Department during the so-called "Manhattan Project". The basic principle of the Monte Carlo Method is to implement on a computer the Strong Law of Large Numbers (SLLN) (see also Lecture 9). The Monte Carlo Method is also typically used as a probabilistic method to numerically compute an approximation of a quantity that is very hard or even impossible to compute exactly like, e.g., integrals (in particular, integrals in very high dimensions!). The goal of Problem 2 is to write a Python code to estimate the irrational number
Answer:
can you give more detail
Explanation:
6. Why did he choose to install the window not totally plumb?
Answer:
Because then it would break
Explanation:
You achieve this by obtaining correct measurements. When measuring a window, plumb refers to the vertical planes, and level refers to the horizontal planes. So he did not install the window totally plumb
For this problem, you will write a function standard_deviation that takes a list whose elements are numbers (they may be floats or ints), and returns their standard deviation, a single number. You may call the variance method defined above (which makes this problem easy), and you may use sqrt from the math library, which we have already imported for you. Passing an empty list to standard_deviation should result in a ZeroDivisionError exception being raised, although you should not have to explicitly raise it yourself.
Answer:
import math def standard_deviation(aList): sum = 0 for x in aList: sum += x mean = sum / float(len(aList)) sumDe = 0 for x in aList: sumDe += (x - mean) * (x - mean) variance = sumDe / float(len(aList)) SD = math.sqrt(variance) return SD print(standard_deviation([3,6, 7, 9, 12, 17]))Explanation:
The solution code is written in Python 3.
Firstly, we need to import math module (Line 1).
Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).
We can test the function using a sample list (Line 20) and we shall get 4.509249752822894
If we pass an empty list, a ZeroDivisionError exception will be raised.
What do we call data that's broken down into bits and sent through a network?
Answer:
Bits
Explanation: