1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
harkovskaia [24]
4 years ago
12

Im trying to figure out how to write a program that finds prime factors of a number. I have the following but it only works for

the number 12 for some reason. % this program will determine if an integer is prime and determine
% its prime factors function MAIN clear; clc; % define number(s) to be checked, call function, and print output
N = 12; [answer,primefactors] = primey(N); fprintf('Is %i a prime? %s \n', N, answer) fprintf('The primefactors of %i are: \n' , N) fprintf('%i \n' , primefactors) N = 12; [answer,primefactors] = primey(N); fprintf('Is %i a prime? %s \n', N, answer) fprintf('The primefactors of %i are: \n' , N) fprintf('%i \n' , primefactors) end % end of function MAIN function [answer,primefactors] = primey(N); if mod(N,1)==0 & N/N==1 answer= 'Yes'; else answer= 'No'; end for k= 2:N-1 if mod(N,k)==0 factors(k)=k; end [a,b]= find(factors>0); b primefactors= [1:numel(b)-1] numel(b) for j= 1:numel(b)-1 if mod(b(j),j)==0 primefactors(j)=b(j) end end end end
Computers and Technology
1 answer:
Paladinen [302]4 years ago
7 0
The reason your program isn't working is because you put the n=12 now when you put the other n's in the code it causes it to only work with the number 12
You might be interested in
A security system uses sensors at every door and window which will set off an alarm if any one of them is opened. There is also
AnnyKZ [126]
You have a raspberry pi connected to all the sensors and a code running to  trigger if the sensors are triggered. Each sensor and keypad would run to a different input on the pi. They should al be able to be powered with a single cell lipo. Is that what you are asking?
5 0
3 years ago
What would you use to see what network adapters are installed in your windows computer?
Lesechka [4]
I wouldn't see anything, because my computer does not use any network adaptors.
6 0
3 years ago
What is the serializable interface and what makes an object serializable?
Varvara68 [4.7K]

Answer: Serializable interface is the interface that acts as the maker persisting without any specific method and members in Java. The maker has the objective of identification of class for serialization method. This helps in the conversion of the object value in the byte form.

Object is serialized by converting the state into byte version and thus can be returned to object copy . The java.io.Serializable interface is the requirement for the conversion of any object of particular class or superclass. This technique is followed for making the data flow on the network efficient and easy.

5 0
4 years ago
An operating system change that fixes bugs improves security or enhanced features is called
Vika [28.1K]

An operating system change that fixes bugs improves security or enhanced features is called update.

It is very important to update your operating system because having the latest software version means your computer or device will be not only be more secure but will also perform better and be more reliable.

5 0
3 years ago
Read 2 more answers
Classify each of the following acts as a violation of confidentiality, of data integrity, source integrity, or availability, or
AlexFokin [52]

Answer:

A) Violation of Confidentiality and Source Integrity:

Passwords are very confidential information and are usually protected by both the owner and the ower of the system (which in this case is Yahoo). To obtain the passwords, the hacker had to illegally gain access to the source of the data which is on Yahoo servers. Hence a breach of confidentiality and lack of adequate integrity on the part of Yahoo.

B) Source Integrity: Anthony accidentally cuts the electricity from the server room. Why would he be able to do that? how did he gain access into the server room? This speaks to source integrity. People should not be able to access the server room except they are authorised.

C) Source Integrity and Confidentiality: NSA finds an efficient method to break AES. AES refers to the Advanced Encryption Standard. AES is a symmetric encryption technology known as a block cipher.

It is used by the United States Government for the classification of information. Their ability to break this code speaks to Violation of Source Integrity. In this case, they haven't exactly hacked any document. However, any document that was encrypted using this technology is already compromised at the source.

D)   Anna registers the domain name, "JohnSmith" and refuses to let John Smith buy or use the domain name: Violation of Availability.

It is assumed here that John Smith was the original owner of the domain but it was highjacked at expiration and registered by Anna. This kind of breach is called Violation of Availability of the domain name.

E) Some malware encrypts the victim’s hard drive with a secret key and a criminal asks for a ransom to decrypt.

This move is called the Ransomeware attack. The Integrity of the source of information (which is the hard drive) is already compromised. This is a combination of Source Integrity or availability and confidentiality violation.

F) The wiretapping of a cell phone is a breach of confidentiality and data integrity.

G) when there is a vulnerability in a system or software that is unknown to those who should be interested, it is called a Zero-Day vulnerability. Where there is a Zero-Day vulnerability there could be a violation of confidentiality, data integrity, source data and or it's availability.

Cheers!

4 0
4 years ago
Other questions:
  • What problem does Mitra identify in education? How can the internet and social media influence this problem?
    14·1 answer
  • When you enable user access control (uac)
    11·1 answer
  • In this assignment, you are to create a class named Payroll. In the class, you are to have the following data members: name: Str
    9·1 answer
  • Why would you group data in a report? SQL
    9·1 answer
  • What protocol communicates data between routers representing the edges of autonomous systems?Distance-vectorLink stateInterior g
    11·1 answer
  • A program executes 100 billion instructions. It executes on an IBM processor that has an average CPI of 1.2 and a clock frequenc
    15·1 answer
  • How can a signature be added to an email message? Check all that apply.
    10·2 answers
  • A weighted GPA counts__more highly.
    12·1 answer
  • Which of the following items can you locate in a document using the navigation pane? Choose the answer.
    10·1 answer
  • When spraying pesticide wear and protective eyeglass​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!