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
(Java) Write a program that accepts a number of minutes and converts it both to hours and days. For example, 6000 minutes is 100
iogann1982 [59]
Import java.util.Scanner;
public class MinutesConversion {
private static Scanner inputDevice;
public static void main(String[] args) {
int minutes, hours;
float days; // float for decimal point

inputDevice = new Scanner(System.in);
System.out.println("Please enter minutes for conversion >> ");
minutes = inputDevice.nextInt();
hours = minutes / 60;
days = hours / 24.0f;


System.out.println(+ minutes + " minutes is " + hours + " hour(s) or" + days " days");
}
}
6 0
3 years ago
What is a stereo type?
Aleks04 [339]

Hello!

A stereotype is a generalized belief about a particular category of people.

 

3 0
3 years ago
Read 2 more answers
What type of maintenance is required of a computer’s power supply to ensure that it remains in working order?
True [87]
<span>d. Clean any dust or debris from the air vents in front of the fans.</span>
5 0
3 years ago
Read 2 more answers
The _____ row is typically the first row in a table.<br><br> banded<br> total<br> header<br> odd
rusak2 [61]

the first row of the table is know as the table header.

8 0
2 years ago
Read 2 more answers
What do you mean by Information Technology explain​
Elena-2011 [213]

Answer:

False

Explanation:

Chloroplasts = photosynthesis

mitochondria= cellular respiration

5 0
2 years ago
Read 2 more answers
Other questions:
  • Tim has an old server computer that his company uses as a backup. One of the hard drives has gone bad and needs to be replaced.
    13·1 answer
  • (Complete the Problem-Solving discussion in Word for Programming Challenge 2 on page 404. Your Problem-Solving discussion should
    13·1 answer
  • Mary is entering her senior year of college. She has a meeting on Friday with her advisor to discuss her career plans.Mary is al
    15·1 answer
  • For a class project, Jerome builds a simple circuit with a battery and three light bulbs. On his way to school, Jerome drops his
    9·1 answer
  • What natural resource are available on the coast but not somewhereelse
    13·1 answer
  • What are some good websites i can use to test my knowledge?
    11·2 answers
  • The electric company gives a discount on electricity based upon usage. The normal rate is $.60 per Kilowatt Hour (KWH). If the n
    7·1 answer
  • If your computer has a ________, someone else can gain access to it undetected.
    10·1 answer
  • Write a java program to find the perimeter of a triangle with sides measuring 10cm, 14cm and 15 cm.
    8·1 answer
  • Question #1
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!