Write a C++ program that takes input from the keyboard of the 3 dimensions of a room (W,L,H in feet) and calculates the area (square footage) needed to paint the walls only. Use function overloading in your program to pass variables of type int and double. You should have two functions: one that accepts int datatypes and one that accepts double datatypes. Also assume a default value of 8 if the height parameter is omitted when calling the functions.
In: Computer Science
Write a Java program where you will set the datatype and variables to find the value of following expression.
The Values of the variables to be used are given below
a) 101 + 0) / 3
b) 3.0e-6 * 10000000.1
c) true && true
d) false && true
e) (false && false) || (true && true)
f) (false || false) && (true && true)
In: Computer Science
PUT IN PYTHON LANGUAGE CODE
# Write one while-loop that starts at 500 and prints every 6th
number down to 300
# (i.e., prints 500, 494, 488, . . . etc., but does not print any
number lower than 300).
# Write one while-loop that starts at 80 and prints every 12h
number thereafter,
# but does not print any number greater than 210
# Write one while-loop that prints all the numbers from 30
through 70,
# except for the numbers 41 and 57.
# Write one while-loop that prints the sum of all the even
numbers
# (50, 52, 54, . . . etc.,) from 50 through 2000.
# Write one while-loop that prints the count of all the
numbers
# from 20 through 2500 that are divisible by 9
# (in other words prints out how many numbers are divisible by
9).
In: Computer Science
1. Use long division to convert decimal fraction into a binary expansion. 3/5
2. Find the decimal equivalent for the following binary numbers. 1101.11102
3. Use long division to convert decimal fraction into a binary expansion. 3/4
4. Find the binary equivalent the following decimal numbers. 14. 25390625 1
5. Find the decimal equivalent for the following binary numbers. 0.110001102
6. Exactly how many bytes are in the following? 60MB
In: Computer Science
Create a Python file num_utils.py that includes:
Create a Python file test_num_utils.py that:
In: Computer Science
1. Add the following binary numbers in 4-bit, two's complement notation. Identify any overflow errors. 01102 + 01002
2.Add the following binary numbers in 4-bit, two's complement notation. Identify any overflow errors. 10102 + 11112
3.Add the following binary numbers in 4-bit, two's complement notation. Identify any overflow errors. 10112 + 01112
In: Computer Science
Given the following memory values and address instruction with an accumulator. Determine the values with the following instructions load into accumulator.
Word 16 contains 22
Word 18 contains 24
Word 20 contains 26
Word 22 contains 28
Word 24 contains 30
Word 26 contains 32
Word 28 contains 34
i. LOAD IMMEDIATE 16
ii. LOAD DIRECT 16
iii. LOAD INDIRECT 16
iv. LOAD IMMEDIATE 18
v. LOAD DIRECT 18
vi. LOAD INDIRECT 20
vii. LOAD IMMEDIATE 24
viii. LOAD DIRECT 26
ix. LOAD INDIRECT 22
x. LOAD DIRECT 28
[10 Marks]
In: Computer Science
Identify any THREE (3) input devices and THREE (3) output devices which are
common used in our life. Discuss the benefits of using these devices in our daily
life.
[18 Marks]
In: Computer Science
1. Add the following binary number in 8-bit. Rewrite each problem in decimal notation to check you work. 10110101112 + 011001002
2. Find the binary equivalent the following decimal numbers. 0.25
3. Find the decimal equivalent for the following binary numbers. 1110102/100000002
4. Find the decimal equivalent for the following binary numbers. 0.00102
5. Give the multiplying factor associated with each of the following metric prefixes. Deci-
6. Find the binary equivalent the following decimal numbers. 0.6875
7. Exactly how many bits are in the following? 40 GB
8. Use long division to convert decimal fraction into a binary expansion. 3/5
9. Find the decimal equivalent for the following binary numbers. 1101.11102
10. Use long division to convert decimal fraction into a binary expansion. 3/4
11. What is the best approximation of the decimal fraction 2/3, using a denominator of 8, 16, 256?
12. Find the binary equivalent the following decimal numbers. 14. 25390625
13. Find the decimal equivalent for the following binary numbers. 0.110001102
14. Exactly how many bytes are in the following? 60MB
In: Computer Science
SQL Program True/False Question
1. Which of the following is true of a many to many relationship? T/F
2. Security is rarely a concern for most databases. T/F
3. A security requirement refers to the need to restrict who can access some of the database data. T/F
4. Report requirements refer to the input forms the database will need. T/F
5. Insert permission is the permission to add records to the database. T/F
6. A trigger is code usually written in SQL which is triggered by a database event such as an insert or delete. T/F
7. A data requirement refers to the need to gather data about the database. T/F
8. One to one relationships are the most common relationship in a relational database. T/F
9. If you have an attribute that can have multiple values you should just number them 1, 2, 3, etc. T/F
10. Ideally every attribute in a database should have a unique name. T/F
11. Lookup entities have no effect on data consistency and integrity T/F
In: Computer Science
In C: Find a string within a string Given two strings S1 & S2, search for an occurrence of the second string within a first string. Note: Do not use system library for the implementation. Input: Code Zinger University Zinger where, First line represents string S1. Second line represents string S2. Output: 5 Here 'Zinger' word starts at 5th index within 'Code Zinger University’. Assume that, The length of strings S1 & S2 are within the range [1 to 10000]. Character comparisons will be case-sensitive.
In: Computer Science
Develop a test strategy for testing the entire application chosen in unit 3 for analysis and design. Keep in mind that testing that involves users should minimize their time commitment while obtaining essential information from their involvement. Specifically define roles, responsibilities, timing, and test strategy for each level of testing.
In: Computer Science
In: Computer Science
Write a linear-search Java method to test if a String array is already sorted alphabetically. The prototype should be static boolean ifsorted(String [] s)
{
}
In: Computer Science
Java programming extra credit.
The following program will be used to test your knowledge on Implementing with tester classes. Included is the Details class. Your assignment is to create a class named DetailsTester using info from the two classes(Procedure class is only included to know the details of the procedure, which includes desc, date, and cost) Patient class is included as well.That will properly implement the class.
| package doctorOffice; | |
| import java.time.LocalDate; | |
| import java.time.LocalDateTime; | |
| import java.util.ArrayList; | |
| public class Patient extends Person | |
| { | |
| //Instance variables | |
| private LocalDate birthDate; | |
| private Details details; | |
| //Default Constructor | |
| public Patient() { } | |
| //Constructor | |
| public Patient(String name, | |
| LocalDate birthDate, | |
| int ssn) | |
| { | |
| this.name = name; | |
| this.birthDate = birthDate; | |
| this.ssn = ssn; | |
| } | |
| //Getters-------------------------------------- | |
| public Details getDetails() | |
| { | |
| return details; | |
| } | |
| public LocalDate getBirthDate() | |
| { | |
| return birthDate; | |
| } | |
| } |
package doctorOffice;
import java.util.ArrayList;
import java.time.LocalDate;
public class Details
{
//Instance variables
private Patient patient;
private double height;
private double weight;
private ArrayList procedures = new ArrayList();
private LocalDate lastVisit;
Details(Patient patient,
double height,
double weight)
{
this.patient = patient;
this.height = height;
this.weight = weight;
}
//Getters--------------------------------------
public Patient getPatient()
{
return patient;
}
public double getHeight()
{
return height;
}
public double getWeight()
{
return weight;
}
public ArrayList getProcedures()
{
return procedures;
}
public LocalDate getLastVisit()
{
return lastVisit;
}
//Setters--------------------------------------
public void setHeight(double height)
{
this.height = height;
}
public void setWeight(double weight)
{
this.weight = weight;
}
public void setLastVisit(LocalDate lastVisit)
{
this.lastVisit = lastVisit;
}
//Methods--------------------------------------
public boolean addProcedure(Procedure toAdd)
{
//LOGIC HERE
return true;
}
}
*******
package doctorOffice;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
//Procedure class holds information about any procedures
performed on the patients
public class Procedure
{
private String desc;
private double cost;
private LocalDate date;
public Procedure(String desc, double cost, String
date) throws Exception
{
this.desc = desc;
this.cost = cost;
this.date = LocalDate.parse(date,
DateTimeFormatter.ofPattern("MM/dd/yyyy"));
}
//getters
public String getDesc()
{
return this.desc;
}
public double getCost()
{
return this.cost;
}
public LocalDate getDate()
{
return this.date;
}
//toString override
public String toString()
{
String output = "Description: " +
desc;
output += "\n\nCost: " +
cost;
output += "\n\nDate: " +
date.toString();
return output;
}
}
In: Computer Science