I need to create a monthly loan Calculator in C++. I know the formula but can't figure out what's wrong with my code. Any clarification would be appreciated!
// Only add code where indicated by the comments.
// Do not modify any other code.
#include <iostream>
#include <cmath>
using namespace std;
int main() {
// ---------------- Add code here
--------------------
// -- Declare necessary variables
here
--
int years = 0; //n
int LoanAmount = 0;
double AnnualRate = 0.0; //r
double payment = 0.0;
// --
cout << "Enter the amount, rate as a
percentage (e.g. 3.25), and number of years\n";
cout << " separated by spaces: " <<
endl;
// ---------------- Add code here
--------------------
// -- Receive input and compute the monthly payment
--
cin >> LoanAmount >> AnnualRate >>
years;
AnnualRate = AnnualRate / 100;
years = years * 12;
payment = ((LoanAmount * AnnualRate) / 1 - (1 +
AnnualRate) * -years);
// ---------------- Add code here
------------------
// Print out the answer as a double, all by
itself
// (no text) followed by a newline
// Ex. cout << payment << endl;
cout << payment << endl;
return 0;
}
In: Computer Science
Develop a C program for matrix multiplication focusing on using malloc and pointers WITHOUT USING BRACKETS [] !!
* DO not use [ ] 'brackets', focus on using malloc, calloc, etc...
Program will ask user for the name of the text file to be
read
Read the datafile with format:
1
2
1
1 2
3
4
So the first three lines will represent m, n, p (Matrix A: m x n
||| Matrix B: n x p), follwing are the two matrices.
Representing:
A = |1 2| B = |3|
|4|
------------------------------------------------
example input and output:
Matrix A contents:
1 2
3 4
5 6
Matrix B contents:
7 8
9 10
11 12 13 14
Matrix A * B is:
29 32 35 38
65 72 79 86
101 112 123 134
The datafile read for this example is:
3
2
4
1 2
3 4
5 6
7 8 9 10
11 12 13 14
In: Computer Science
Specification
This script reads in class data from a file and creates a
dictionary.
It then prints the data from the dictionary.
The script has the following functions
class_tuple_create
This function has the following header
def class_tuple_create(filename):
The function reads in a file with four fields of data about a
class.
The fields are
Course ID Room number Instructor Start time
The function must print an error message if the file cannot be
opened for any reason.
The function should read in each line of the file and split it into
a list of 4 elements.
It should add the information in the line into a dictionary, where
the key is the course number and the value is a tuple consisting of
the room number, the instructor and the start time.
The function should return this dictionary when it has read all the
lines in the file.
print_classes
This function has the following header
def print_classes(class_info):
It should print the following table header
ID Room Instr Start
Then it should print out the data for each class in alphabetical
order by Class ID.
The data for each course should align with the labels.
Test Code
The script must contain the following test code at the bottom of the file
class_information = class_tuple_create('xxxxx') class_information = class_tuple_create('courses.txt') print_classes(class_information)
For the test code to work you must copy into your hw3 directory the file from /home/ghoffman/course_files/it117_files.
cp /home/ghoffman/course_files/it117_files/courses.txt .
Suggestions
Write this script in stages, testing your script at each step
Output
The output should look something like this
Error: Unable to open xxxxx ID Room Instr Start ------------------------------- CM241 1411 Lee 13:00 CS101 3004 Haynes 8:00 CS102 4501 Smith 9:00 CS103 6755 Rich 10:00 NT110 1244 Burke 11:00
In: Computer Science
Implement an infix expression to postfix expression convertor in C++.
Note: - Support +, -, *, /, ( and ) in infix expressions.
- Operands will be nonnegative only.
- Assume infix expressions are valid and well formatted (one blank space to separate operand/operator)
For example,
- 3 * 4 + 5 ➔ 3 4 * 5 +
- 3 + 4 * 5 ➔ 3 4 5 * +
- (3 + 4) * (5 + 6) ➔ 3 4 + 5 6 + *
In: Computer Science
Write a C# console program that continually asks the user "Do you want to enter a name (Y/N)? ". Use a "while" loop to accomplish this. As long as the user enters either an upper or lowercase 'Y', then prompt to the screen "Enter First and Last Name: " and then get keyboard input of the name. After entering the name, display the name to the screen.
In: Computer Science
Describe how cloud computing may lead to “intelligent fabrics” in the future and how this will impact companies and consumers. Use real-world examples to support your assertions.
In: Computer Science
Write a C# console program that continually asks the user "Do you want to enter a name (Y/N)? ". Use a "while" loop to accomplish this. As long as the user enters either an upper or lowercase 'Y', then prompt to the screen "Enter First and Last Name: " and then get keyboard input of the name. After entering the name, display the name to the screen.
In: Computer Science
Linux Fundamentals part 4 final Below are questions related to the command line use of Linux. You can use the videos, man pages, and notes to answer these questions. Remember that Linux is CASE SENSITIVE. Rm and rm are NOT the same command. I will count off totally for a question if you do not take this into account. For each command give me the ENTIRE COMMAND SEQUENCE. If I ask you 'What command would I use to move the file one.txt to the parent directory and rename it to two.txt?", the answer is NOT 'mv'. That is only part of the command. I want the entire command sequence.
16. Find all files under ~ whose content contain the keyword taco OR Taco OR taCo OR tacO. NOT all variations in case for 'taco', but just the variations listed meaning a keyword of tAco, tACO, tACo, etc, will not produce a result.
17. Find all files under the current directory which ends in
'.txt' (just the .txt not the single quotes) and use -exec to
create a listing of each files inode number. Since we're using
-exec, this means we will call another command to produce the inode
based on the results found. What command do we use to make
listings? Now you just need to find how to make it produce an inode
result. To the man page!
18. What command would I run to update the database of file
names used by the locate command?
19. Find all files under the /var directory with a size less
than 1 kilobyte. Use -exec and an appropriate command to copy those
files to ~/Documents/FallFun/sep.
20. Find all files under the ~ directory that are named
'Picard' ignoring case.
In: Computer Science
Prove that the following language are NOT regular using the pumping lemma
(20 pt.) ? = {? ∈ {?, #}∗ | ? = ??#??# ... #?? ??? ? ≥ ?, ?? ∈
?∗ ??? ????? ?, ??? ?? ≠?? ???????? ?≠?}
Hint: choose a string ? ∈ ? that contains ? #’s.
In: Computer Science
implement Max Subarray Problem via Divide-and-conquer off this code
#include <iostream>
#define MAX_INT 2147483647
using namespace std;
int main(int argc,char **argv) {
int* array;
int arraySize = 1;
// Get the size of the sequence
cin >> arraySize;
array = new int[arraySize];
// Read the sequence
for(int i=0; i<arraySize; i++){
cin >> array[i];
}
In: Computer Science
Configuring Windows Firewall
In this project, you edit configuration settings on Windows Firewall.
Note
Windows Firewall uses three different profiles: domain (when the computer is connected to a Windows domain), private (when connected to a private network, such as a work or home network), and public (used when connected to a public network, such as a public Wi-Fi). A computer may use multiple profiles, so that a business laptop computer may use the domain profile at work, the private profile when connected to the home network, and the public profile when connected to a public Wi-Fi network. Windows asks whether a network is public or private when you first connect to it.
1
Click Start, click the search icon, and enter Firewall.
2
Click Windows Firewall Control panel.
3
Click Turn Windows Firewall on or off. Be sure that the Windows Firewall is turned on for both private and public networks.
4
Under Public network settings check Block all incoming connections, including those in the list of allowed apps. This provides an extra level of security when using a public network such as a free Wi-Fi network by preventing a malicious incoming connection from another computer on the network. Click OK.
5
To allow an inbound connection from an installed application, in the left pane click Allow an app or feature through Windows Firewall.
6
Each program or feature of Windows can be chosen to allow an incoming connection on public or private networks. Click Allow another app.
7
From here you can select an app that will permit an incoming connection. Because this is a security risk, click Cancel and then OK.
8
Now check the configuration properties of Windows Firewall. Click Advanced settings.
9
Click Properties in the right pane.
10
Note the settings on each of the profiles by clicking the Domain Profile, Private Profile, and Public Profile tabs. Is there any difference in the settings between these profiles? Why?
11
On each tab under Settings, click Customize. Be sure that Display a notification is set to Yes. Why would this be important?
12
Click OK to return to the Windows Firewall with Advanced Security page.
13
In addition to being application-aware, Windows Firewall also can be configured for firewall rules. Click Outbound Rules in the left pane to block a program from reaching the Internet.
14
In the right pane, click New Rule.
15
Click Port and then click Next.
Note
In addition to ports, the Windows Firewall also can block by program (Program) or even by program, port, and IP address (Custom).
16
If necessary, click TCP.
17
Next to Specific remote ports: enter 80. Click Next.
18
If necessary, click Block the connection. Click Next.
19
Be sure that this new rule applies to all three domains. Click Next.
20
Under Name: enter Blocking Port 80. Click Finish.
21
Now open a web browser and try to connect to the Internet. What happens?
22
Click the Back button to return to the Windows Firewall screen and click Action and Restore Default Policy to disable this rule. If a warning dialog box appears, click Yes. Click OK.
23
Select Outbound Rules in the left pane. In the right pane, click New Rule.
24
Click Custom and Next.
25
If necessary, click All programs and Next.
26
Note that you can configure a firewall rule based on protocol, protocol number, local port, and remote port.
27
Click Cancel.
28
Close all windows.
please answer all the questions, and take screenshots of all the steps
In: Computer Science
What is printed?
public static void main(String[] args)
{
int i = 6;
aMeth(i);
System.out.print(i);
}
public static void aMeth(int i)
{
System.out.print(i);
i = i + 1;
System.out.print(i);
}
2)
What is printed as the value of b?
Scanner kybd = new Scanner(System.in);
System.out.println("Enter two ints " );
int i = kybd.nextInt();
int j = kybd.nextInt();
boolean b = ((i % 2) == 0) && ((j % 2) == 0);
System.out.println(b);
3)
In: Computer Science
Generating a sequence using Pthreads
Having multiple threads call a function, like will have a non-deterministic execution. Write a program with 3 threads that call a function called do_work. Each thread will be responsible for generating a number and appending it to a buffer. Thread 1 generates number 1, thread 2 generates number 2, and thread 3 generates number 3. These numbers assigned to the threads are passed in as arguments. Each thread will store its value in a shared buffer of integers having a size of 3 elements called “buffer”. When the third element is added to the buffer by either thread 1, 2 or 3, then it checks to see if the sequence is “123”. If not, it clears the buffer and the threads try to generate the sequence again. Once the total number of sequences of “123” reach 10, the threads print out the total number of tries it took to print “123”. For example, keep track of the total number of other sequences generated (includi it should print out it’s corresponding number. Below is example output at the end of the program’s execution. Ensure that your program produces the exact same output formatting; you will see why in a moment. ...
My id: 2
My id: 1
Total ses geneted: 38
Number of cect sequences: 10
Testing:
You will test that your program appears to work correctly. I provide you with a python script that tests the output of your program: A3sequence_test.py. After you believe your pr document it as well, with screenshots and a text description. For instance “my program never stops running and it should stop because the counter value is 10 and therefore...”.
In: Computer Science
1) Consider an automated teller machine (ATM) in which users
provide a personal identification number (PIN). Discuss what
confidentiality, integrity, availability, authenticity, and
non-repudiation refer to in this type of service.
2) Discuss how design principles of abstraction, modularity, and
layering help with security.
In: Computer Science
You work for a hospital in the registration and admissions department, and most of your tasks are performed manually. For example, when an individual checks in, you must obtain personal information, details on an individual’s medical background, and hospitalization insurance. You are a strong advocate for information technology and have proposed to IT management that information systems would be beneficial. The hospital has decided to develop and implement an information system that helps to streamline your processes. Since you have extended personal experience with the processes, and you have considerable knowledge of information systems and technology employed by your counterparts at other hospitals, you have been asked to function as the project business analyst. You will work very closely with the IT department’s system analyst. The system analyst has questions regarding the following:
In a 3–5-page Word document, be sure to include the following.
In: Computer Science