Determine the representation for the following decimal numbers in single-precision IEEE 754 format. Give them in 32-bit binary and show the calculation.
-10^(−8)
In: Computer Science
Draw a flowchart that will calculate the roots of a quadratic equation. (java)
Can someone draw it for me? and at same time explain,
In: Computer Science
Asks the user "How many parrots do you own?"
2: Reads in that many single word names (one for each parrots) from the user and stores the names in an array.
3: After the user has finished entering names, the program should display the list of all the parrots the user entered.
4: then display the parrots in alphabetical order for part 3. Note: string objects can be compared with the “<” operator, which will determine if a given string is alphabetically less than another string.
You may assume the user will own at most 100 parrots.
c++
"output"
Welcome! How many dogs do you own?
- 4
Ok, enter the names!
> james
> flyingmo
> homer
> kitty
these are the names you entered: flyingmo, homer, james, kitty
In: Computer Science
In: Computer Science
Code should be Written in C
Use the data from the example below.
Candidates Subdivisions Totals
Brampton Pickering Markham
Aubrey 600 800 800 2200
Blake 700 700 600 2000
Chubbs 800 700 800 etc
Oliver 400 450 300
Zamier 900 900 900
Totals 3400 etc etc
In: Computer Science
AWS(Amazon Web Services):
As an organization grows, what are some aspects to consider with regard to EC2 Instances, EBS, and Elastic IPs if any (i.e. aspects to consider: architectural, performance, cost, etc.)?
In: Computer Science
You are writing a billing program that adds up the items a user enters. Your program should use a loop and prompt the user for the item number for each item in inventory to add to the bill. (You can ask the user for the number of items you will enter and use a counter controlled loop or a sentinel controlled loop that has a stop number. Either way is fine.) Here is the table of items in inventory:
Item Value
1 209.00
2 129.50
3 118.00
4 232.00
(So if your program starts asking the user for the items they are purchasing and they enter item 2 with quantity 2, and item 3 with quantity 1. The bill should be 377.00. On the next run if your program asks the user for items in the loop and they give enter each item with quantity of 1. The bill should be 688.50
[You must use an IF or IF/Else Structure to look up the item value for the item number they give or you are missing an objective on this assignment.] Use Java and NetBeans *.0 version to solve this. Must use a simple loop and nested if statement.
In: Computer Science
Create a driver class to do the following:
a.
Read data from the given file BankData.data and create and array of BankAccount Objects
The order in the file is first name, last name, id, account number, balance. Note that account
name consists of both first and last name
b.
Print the array (without account id) the account balance must
show only 2 decimal digits. You will need to do some string processing.
c.
Find the account with largest balance and print it
d.
Find the account with the smallest balance and print it.
e.
Determine if there are duplicate accounts in the array. If there are then set the duplicate account
name to XXXX XXXX and rest of the fields to 0. Note it’s hard to “delete” elements from an array.
Or add new accounts if there is no room in the array. If
duplicate(s) are found, print the array.
Main.cpp
#include <iostream>
#include <fstream>
#include <string>
#include //your header file
using namespace std;
const int SIZE = 8;
void fillArray (ifstream &input,BankAccount
accountsArray[]);
int largest(BankAccount accountsArray[]);
int smallest(BankAccount accountsArray[]);
void printArray(BankAccount accountsArray[]);
int main() {
//open file
//fill accounts array
//print array
//find largest
//find smallest
//find duplicates and print if necessary
BankAccount accountsArray[SIZE];
fillArray(input,accountsArray);
printArray(accountsArray);
cout<<"Largest Balance:
"<<endl;
cout<<accountsArray[largest(accountsArray)].toString()<<endl;
cout<<"Smallest Balance
:"<<endl;
cout<<accountsArray[smallest(accountsArray)].toString()<<endl;
}
}
void fillArray (ifstream &input,BankAccount
accountsArray[]){
}
int largest(BankAccount accountsArray[]){
//returns index of largest account balance
}
int smallest(BankAccount accountsArray[]){
//returns index of smallest
}
BankAccount removeDuplicate(BankAccount account1, BankAccount
account2){
return (account1.equals(account2));
}
void printArray(BankAccount accountsArray[]){
cout<<" FAVORITE BANK - CUSTOMER DETAILS
"<<endl;
cout<<"
--------------------------------"<<endl;
//print array using to string method
}
BankData.data
Matilda Patel 453456 1232 -4.00 Fernando Diaz 323468 1234 250.0 Vai vu 432657 1240 987.56 Howard Chen 234129 1236 194.56 Vai vu 432657 1240 -888987.56 Sugata Misra 987654 1238 10004.8 Fernando Diaz 323468 1234 8474.0 Lily Zhaou 786534 1242 001.98
In: Computer Science
Could someone please tell me what corrections I should make to this code. (Python)
Here are the instructions.
I can't get the find function to work and I have no idea how to even go about it. For example, when type in 'find' and I enter the rating, I'm always getting an error. I need help.
def list(movie_list):
if len(movie_list) == 0:
print("There are no movies in the list.\n")
return
else:
i = 1
for row in movie_list:
print(str(i) + ". " + row[0]+ " (" + str(row[1]) + ")"+","+
"$"+str(row[2])+","+str(row[3]))
i += 1
print()
def add(movie_list):
name = input("Name: ")
year = input("Year: ")
price = int(input("Price:"))#price
rating =input("Rating:")
movie = []
movie.append(name)
movie.append(year)
movie.append(price)#adding price to the movie list
movie.append(rating)#adding rating to the movie list
movie_list.append(movie)
rating_list.append(movie)
print(movie[0] + " was added.\n")
def delete(movie_list):
number = int(input("Number: "))
if number < 1 or number > len(movie_list):
print("Invalid movie number.\n")
else:
movie = movie_list.pop(number-1)
print(movie[0] + " was deleted.\n")
#find by rating function
def find_by_rating(movie_list,rating):
if len(movie_list)==0:
print("Find")
return
else:
movie_list=[]
for i in movie_list:
if i[3]==rating:
movie_list.append(i[0])
if len(1)==0:
print("No movies are present with given rating")
else:
print("Movies:")
for i in movie_list:
print(i)
def display_menu():
print("COMMAND MENU")
print("list - List all movies")
print("add - Add a movie")
print("del - Delete a movie")
print("find- find movie by rating")
print("exit - Exit program")
print()
def main():
movie_list = [["Matrix",1999,9.75,"R"],
["Under the Tuscan",2003,4.99,"PG"],
["V for Vendetta", 2005,14.99,"R"]]
display_menu()
while True:
command = input("Command: ")
if command == "list":
list(movie_list)
elif command == "add":
add(movie_list)
elif command == "del":
delete(movie_list)
elif command == "find": #added find command
rating=input("Enter rating:")#taking the rating
find_by_rating(movie_list,rating)#the call
elif command == "exit":
break
else:
print("Not a valid command. Please try again.\n")
print("Bye!")
if __name__ == "__main__":
main()
In: Computer Science
Write a C++ program that takes two sets ’A’ and ’B’ as input read from the file prog1 input.txt. The first line of the file corresponds to the set ’A’ and the second line is the set ’B’. Every element of each set is a character, and the characters are separated by space. Implement algorithms for the following operations on the sets. Each of these algorithms must be in separate methods or subroutines. The output should be written in the file prog1 output.txt. Write a title before the output of each operation. 1. Union 2. Intersection 3. A - B 4. Decide if (A ⊂ B). Program 2 – 50 points Write a program that takes three sets ’A’, ’B’, ’C’ as input read from the file prog2 input.txt. The first line of the file corresponds to the set ’A’, the second line is the set ’B’, and the third line is the set ’C’. Every element of each set is a character, and the characters are separated by space. Implement algorithms for the following operations on the sets. Each of these algorithms must be in separate methods or subroutines. The output should be written in the file prog2 output.txt and the standard output. Write a title before the output of each operation. 1. (A∪B)∪C. 2. A∪(B∩C). 3. (A∪B)∩(A∪C). HINTS You may want to use arrays. Pay special attention to the parentheses because they indicate the order. For example: (A ∪ B) ∪ C means to compute (A ∪ B) first, and then ∪C. Consider reusing the algorithms for union and intersection that you have defined already. For example, to compute (A ∪ B) ∪ C: First, compute A ∪ B using the function that computes the union that you already defined. Let’s say that you store that result in an array R. Then, compute R ∪ C using the function that computes the union that you already defined.
In: Computer Science
1. Articulate the aspects of the university environment to
consider as they adopt and implement ERM.
2. Describe the differences between formal structural and collegial
organizational models as they relate to goal setting, decision
making, and leadership.
3. Analyze strategies utilized at one higher education institution
to adopt ERM processes to fit the decentralized academic
environment.
In: Computer Science
Reimpelment a function called bubble_sort that has the following prototype.
bubble_sort(int *array, int size, pointer to a function)
Pre condition
array - a pointer to a an array of size element.
pointer to function - a pointer to a function that compares two
values (depending on sorting in ascending order or descending
order)
Post condition
Sort the array in ascending or descending based on the the pointer
to a function.
Call the function bubble_sort to sort the array in
ascending
Display the sorting array.
Call the function bubble_sort to sort the array in descending
Display the sorting array.
use a list of integers from a file called data.txt
Here is the content of the file data.txt.
9
8
4
7
2
9
5
6
1
3
In: Computer Science
Suppose you have developed a social media management tool that
you’ve made available as a service to everyone on your office
network. Due to its success, you plan to expand by publicizing and
providing the service to any client on the World Wide Web.
What problems might you expect as your service is requested by an
increasing number of clients, and what are some of the things you
might do to solve the problems?
In: Computer Science
6.27 Ch 2 Program: Painting a wall (C++)
(4)Calculate the cost of the paint. Paint comes in six colors (Red,
Yellow, Green, Blue, Black,White) Assign numbers 0-5 to these paint
colors ie Red =0 and White =5. The costs for each of these paints
is as follows:(2 pts) Now your program will be submission
ready.
Main.cpp
#include <iostream>
#include <cmath>
using namespace std;
#include "paint.h"
int main() {
double wallHeight;
double wallWidth;
double wallArea;
double gallonsPaintNeeded;
int cansNeeded,colorNum;
Color paintColor;
double costArray[numOfColors];
cout << "Enter wall height (feet):
"<<endl;
cin >> wallHeight;
cout << "Enter wall width (feet):
"<<endl;
cin >> wallWidth;
cout<< "Enter paint color as an
integer"<<endl;
cout<<"Red - Enter
0"<<endl;
cout<<"Blue - Enter 1"<<endl;
cout<<"Green - Enter 2"<<endl;
cout<<"Yellow- Enter 3"<<endl;
cout<<"Black - Enter 4"<<endl;
cout<<"White - Enter 5"<<endl;
cout<<"Your color ?"<<endl;
cin>>colorNum;
paintColor= (Color)colorNum; // cast the integer to
type Color
// Calculate and output wall area
// FIXME (1): Calculate the wall's area
cout << "Wall area: " << wallArea <<
" square feet" << endl; // FIXME (1): Finish the
output statement
// FIXME (2): Calculate and output the amount of paint
in gallons needed to paint the wall
cout << "Paint needed: " <<
gallonsPaintNeeded << " gallons" << endl;
// FIXME (3): Calculate and output the number of 1
gallon cans needed to paint the wall, rounded up to nearest
integer
cout << "Cans needed: " << cansNeeded
<<" can(s)" << endl;
//FIX ME (3) populate the cost Array and calculate the
total cost of the paint
cout << "TotalCost: $" << totalCost<<" for
"<<cansNeeded;
switch (paintColor){
case Red: cout<<" Red";
break;
case Blue: cout<<" Blue";
break;
case Green: cout<<" Green";
break;
case Yellow: cout<<" Yellow";
break;
case Black: cout<<" Black";
break;
case White: cout<<" White";
break;
}
cout<<" can(s)" << endl;
return 0;
}
paint.h
#include<fstream>
const double squareFeetPerGallons = 350.0;
const double
gallonsPerCan =
1.0;
const int numOfColors =6;
enum Color {Red, Blue, Green, Yellow, Black,White};
double calculateWallArea(double height, double width){
// height times width
}
double calculatePaintAmount(double wallArea){
//wallarea divided by square feet per gallons
}
int calculateNumberOfCans(double paintAmount){
return ceil(paintAmount/gallonsPerCan); // round up the number of
cans needed
}
void getColorCost(double costArray[]){
//open the data file and read into array
}
double calculateCost(Color paintColor, double costArray[],double
numOfCans ){
// the cost of paint given the color and number of cans
}
cost.txt
1.99
2.99
0.99
2.99
0.49
0.99
In: Computer Science
Traditional banking versus mobile or online banking 1. Discuss an assumption and an associated claim. 2. Based on your selection, describe the main concepts and metaphors that have been used for each (include a marked-up graphic with your description). 3. Describe how they differ. 4. Describe the aspects of the paper-based artifact that informed the digital app. 5. Describe the new functionality and articulate the pros and cons.
In: Computer Science