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
klasskru [66]
3 years ago
5

. Write a swift programming code to perform following tasks a) Declare a variable that stores the age of a person b) Declare a c

onstant that stores the earth gravity 9.8
Computers and Technology
1 answer:
Law Incorporation [45]3 years ago
5 0

Answer:

Here we use the shift programming  code

(a)var age1: Int=24

(b)let ear_grav:Float=9.8

Explanation:

(a) To declared any variable in swift we follow following syntax

Syntax:var variableName = <initial value>

var age1: Int=24

Here age1 is a variable that stores the age of a person

to print this use we print command in swift

print(age1)

(b)To declared the constant in swift we follow following syntax

Syntax: let constantName = <initial value>

let ear_grav:Float=9.8

Here ear_grav is a constant that stores the earth gravity 9.8

to print this use we print command in swift

print(ear_grav)

You might be interested in
Tom only thinks about his own gain and does not care about the team objectives. What quality is he demonstrating? A. resourceful
Grace [21]

Answer:

D. Selfishness

Explanation:

Selfishness is caring about yourself and not others

8 0
3 years ago
In Java, it is possible to create an infinite loop out of while and do loops, but not for-loops. true or false
soldier1979 [14.2K]

Answer:

False is the correct answer for the above question.

Explanation:

  • In java programming language or any other programming language, any loop can be infinite.
  • It is because the infinite loop is called for that loop which is not run in a finite number of times.
  • The loop is used to repeat some lines in a finite number of times. Any loop has three things- first is the initial value which tells the loop to start, The second is the condition check which states when the loop will stop and the third is an operation which directs some variable, so that the condition may be false after some finite amount of time.
  • If the condition will not false in any iteration of the loop, then the loop can proceed for an infinite amount of time.
  • The above-question states that the while loop and do while loop can be infinite which is a true statement.
  • But it also states that the 'for' loop can not be infinite which is not a correct statement which is described above. Hence false is the correct answer to the above question.
8 0
3 years ago
Java can be procedural or object-oriented when it comes to programming. What is the difference between procedural and OOP?​
Helen [10]

Answer:

Procedural Programming => Functions

Object-Oriented Programming => Classes

Explanation:

Procedural programming is essentially what it sounds like – it's a series of procedures that the computer executes out. A procedure is essentially a function built of different steps that you the coder have grouped as such.

Object-Oriented Programming is all about objects. Objects contain data in the form of attributes, and functions in the form of methods. The most popular Object-Oriented Programming languages are class based, meaning that each object is an instance of a class (the class being a template).

Hope that helps! And you can always research more online!

7 0
3 years ago
Describe the concepts of Defense in Depth and Detection in Depth. Compare and contrast. What's different? What's similar?
olchik [2.2K]

Answer:

 The main concept of the defense in depth is that the various defensive mechanism series are used for protecting the data and the information in the system. This approach is basically used multiple layers to control the cyber security. It also mainly provide the redundancy for controlling the security failure in the system.

The detection in depth basically provide the redundant overlapping approach and it is used for detecting the security and also accomplish the response that are available in the security detection.  

5 0
3 years ago
True or False: To create a function in python, you start with the keyword "def"
Butoxors [25]

Answer:

true i think

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • ____ indicates the number of pixels that a computer uses to display the letters, numbers, graphics, and background on a screen.
    12·2 answers
  • Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
    13·2 answers
  • On a wireless router, what gives out IP addresses?<br> DHCP<br> DNS<br> WPA<br> WPS
    7·1 answer
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • What are the advantages of businesses using Twitter ?
    12·1 answer
  • Which of the following variable names is not valid? 1price 1 price price 1 price1
    15·2 answers
  • From the Software Engineering Code of Ethics, which clauses relate to intellectual property (check all that apply)
    15·1 answer
  • In C++ write a program that prints out PI as a type double and a type float EXACTLY as shown below. Your program should have ONE
    13·1 answer
  • Demographics refers to
    7·1 answer
  • Question 6 of 10
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!