Must be written in VBA
Create a program called moremath to request a whole number, n, from 1 to 30, and one of the letters S or P. Then, depending upon whether S or P was selected, calculate the sum or product of the numbers from 1 to n.
Dim n As Integer
Private Sub moremath_Click()
Dim choices(2) As String
Dim i As Integer
Dim index As Integer
choices(1) = "S"
choices(2) = "P"
'Generating whole number
n = Int((30 - 1 + 1) * Rnd + 1)
Cells(2, 1) = n
'Generating index value between 1 and 2
index = Int((2 - 1 + 1) * Rnd + 1)
'Selecting choice based on generated index
choice = choices(index)
Cells(2, 2) = choice
If choice = "S" Then 'If choice is s then
calls function sum()
Call sum
ElseIf choice = "P" Then 'If choice is p then
calls function product()
Call product
End If
End Sub
Private Function sum()
Dim i As Integer
Dim s As Double
'Calculating sum and then displaying in message
box
s = 0
For i = 1 To n
s = s + i
Next i
Cells(2, 3) = s
End Function
Private Function product()
Dim i As Integer
Dim p As Double
'Calculating product and then displaying in
message box
p = 1
For i = 1 To n
p = p * i
Next i
Cells(2, 3) = p
End Function
Link for the file: https://drive.google.com/open?id=0B-wCyuB1jOs7OHUzdE1WdC1pWVU
Output:


Must be written in VBA Create a program called moremath to request a whole number, n,...
In C++, Create an int variable called first and fill it with a whole number taken from the keyboard. Create another int variable called second. Output the sum of first and second, product of first and second, difference of first and second, and the modulus of first and second.
Description: Create a program called numstat.py that reads a series of integer numbers from a file and determines and displays the name of file, sum of numbers, count of numbers, average of numbers, maximum value, minimum value, and range of values. Purpose: The purpose of this challenge is to provide experience working with numerical data in a file and generating summary information. Requirements: Create a program called numstat.py that reads a series of integer numbers from a file and determines...
Question: File response. You must create a program called “Assigment_Mod9.cpp” that allow to manage the inventory of a store. The program must have a menu that allow to perform the following three actions: Add a new item Remove an item Replicate n times and existing item The program must have two dynamic arrays: one for store the name of the product and other to store the price of the product. The size of each array must be of the same...
Exercise 7.1 (lettercount.py, design). Before attempting to program lettercount.py, create a file called design that includes some analysis on how you think the problem will be solved. Examples include: a flowchart of events in the program, pseudocode, or a step by step process written in plain english. If you choose to scan your design please make sure that it is legible. Next write a program that reads in a string on the command line and returns a table of the...
**Program must be written in Pascal** There are 1 to N non-intersecting circles (where N be any number between 2 and 10). Start at circle 1 and randomly choose among the out arrows (all out arrows should be equally likely to be picked). The next circle is the new current circle. Each visited circle gets a "check mark" to indicate it has been visited. Once all circles have at least one check mark, stop the game. Write a program that...
Program must be written in C++: Create a parent class called CompSciProfessor. Each professor has name (type string), email (type string), and facultyId (type long). Specialize the CompSciProfessor class into two more classes: AdjunctProf, and TenureTrackProf classes. The specialized class AdjunctProf has three attributes of its own: degree (type char), NoOfTA (type int), and NoOfCourses (type int). The attribute ‘degree’ refers to the degree of the adjunct professor. You assign ‘B’ to represent bachelor degree, ‘M’ for Master degree, and...
5.4 Java Create a program that generates SuperLotto lottery numbers. Create a class called SuperLottoPlus.java Create a method called generateSuperLottoNumbers() that returns an array of 6 random SuperLotto lottery numbers. The first 5 numbers must be from the range 1 to 47 The 6th number (the MEGA) must be from 1 to 27. Create a method called printTicket() that takes an integer array as an parameter it will loop through the integer array and print out the data Display the...
I need this problem to be solved in Excel VBA code.
Need full code in VBA. Please solve 1st Task : '5 or 0'.
Please help me urgently with proper answer and coding solutions
which I can run in Excel/vba. Thanks
Course: Programming languages Second laboratory work File and string processing Create a program that processes text file according to task variant. Requirements: 1. Create text file (use notepad) with some lines of data according to task variant. 2. Ask...
Create a Java program that uses methods. In the main method, the program must prompt the user for a Social Security Number in the following format: DDD-DD-DDDD, where D is a digit. The program must call a method called “validate” that must receive the inputted SSN from the main method and decide whether the inputted number is valid and return the decision to the main method. Then, the main method must print the decision.
Important: This code must be written without the use of <and> or range. Create the Congress Program as Python program: A) A person is eligible to be a US senator if they are at least 30 years old and have been a US citizen for at least 9 years. B) To be a US representative these numbers are 25 and 7, respectively. C) They are not eligible for either if...? Your program will accept a person's age and years of...