Answer:
function summedValue = SummationWithLoop(userNum)
% Summation of all values from 1 to userNum
summedValue = 0;
i = 0;
% use a while loop that assigns summedValue with the
% sum of all values from 1 to userNum
while(i <= userNum)
summedValue = summedValue + i;
i = i + 1;
end
end
Answer:
# Program is written in python
# 22.1 Using the count method, find the number of occurrences of the character 's' in the string 'mississippi'.
# initializing string
Stringtocheck = "mississippi"
# using count() to get count of s
counter = Stringtocheck.count('s')
# printing result
print ("Count of s is : " + str(counter))
# 2.2 In the string 'mississippi', replace all occurrences of the substring 'iss' with 'ox
# Here, we'll make use of replace() method
# Prints the string by replacing iss by ox
print(Stringtocheck.replace("iss", "ox"))
#2.3 Find the index of the first occurrence of 'p' in 'mississippi'
# declare substring
substring = 'p'
# Find index
index = Stringtocheck.find(substring)
# Print index
print(index)
# End of program
PLEASE HELP
NASA scientists have determined that the chance a single person would get hit by a piece of falling satellite is one in 3,200. What can you infer based on this probability?
A. Satellites that enter Earth’s atmosphere land mostly in the ocean.
B. NASA does a good job informing people of when satellites will enter the atmosphere.
C. Satellites that enter Earth’s atmosphere land mostly in unpopulated areas.
D. Much of a satellite is destroyed during the process of entering Earth’s atmosphere.
Answer:
import java.util.Scanner;
public class InputExample {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int birthMonth;
int birthYear;
birthMonth = scnr.nextInt();
birthYear = scnr.nextInt();
System.out.println(birthMonth+"/"+birthYear);
}
}
Answer:
<u><em>note:</em></u>
<u><em>solution is attached in word form due to error in mathematical equation. furthermore i also attach Screenshot of solution in word due to different version of MS Office please find the attachment</em></u>