Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Complete the Q4-Q6 using the file I upload. Q4: \'Question 4. Sub UnitPrice_and_

ID: 3601481 • Letter: C

Question

Complete the Q4-Q6 using the file I upload.

Q4:

'Question 4.
Sub UnitPrice_and_CostPrice()
'Review the following codes snippets that use a 'IF THEN ELSEIF ... END IF construct
'to determine a products unitPrice based on the productIndex.
  
If productIndex <= 3 Then
unitPrice = 1.2 * unitCost
ElseIf productIndex = 4 Or productIndex = 6 Then
unitPrice = 1.3 * unitCost
ElseIf productIndex = 7 Then
unitPrice = 1.4 * unitCost
Else
unitPrice = 1.1 * unitCost
End If

'Enhance the code to also do the following:
' Declare a variable named 'QuantityPurchased'to be an Integer, and a variable named costPrice to be of type Double.
' Prompt the User to input the 'QuantityPurchased'
' Compute the costPrice as the product of QuantityPurchased and 'discounted' UnitCost as follows:
' if the QuantityPurchased is exactly 15 units, then the UnitCost is discounted by 1%.
' if the QuantityPurchased is between 100 and 200, then the UnitCost is discounted by 15%.
' if the QuantityPurchased is between 50 and 99, then the UnitCost is discounted by 12.5%.
' if the QuantityPurchased is between 20 and 49, then the UnitCost is discounted by 5.5%.
' otherwise (i.e., if neither of the 4 conditions above is true), then there should be no discount.
' **(USE THE 'Select Case ... End Case' CONSTRUCT TO TEST THE CONDITIONS).

' Compute the TotalSales as a product of QuantityPurchased and unitPrice.
' Display the unitPrice, QuantityPurchased, and costPrice (on separate lines) using one MsgBox function.

End Sub

Q5:

'Question 5.
Sub launchSpaceShuttle()
'It takes a space-shuttle approximately 510 seconds (i.e., 8-1/2 minutes ) to get to orbit.
'Using a FOR ... LOOP:
' Write VBA codes for a countdown (at 30 seconds intervals) of the time the shuttle get to orbit.
' Display the seconds remaining after every 30 seconds.
'At the end of the countdown, display Message 'Hurray, The shuttle made it an orbital velocity of 17,500 miles per hour!'.
End Sub

Q6:

'Question 6.
Sub MainArrays()
' The following code concatenates the contents of Range(A5:A15) of the 'Data' worksheet
'into a comma-separated string.

Dim i As Integer
Dim arr(10) As String
Dim myRange As Range, cell As Range
Set myRange = Worksheets("Data").Range("A5:A15")
i = 0
For Each cell In myRange
arr(i) = cell.Value
i = i + 1
Next
MsgBox Join(arr, ",") 'Join concatenates contents of an array.

'Modify the script to:
' Concatenate the content of range (B1:B20) as delimited string. *** Concatenate ONLY cells whose values are at least 415.
' The delimiter should be a variable with an initial valuse set to pipe(a pipe is: '|').
' Display the concatenated string.
End Sub

Excel File:

https://docs.google.com/spreadsheets/d/1VvKepH6BjtK4bpWjZkNAndom_xAXHfqFAmbM6Fd2uRk/edit?usp=sharing

Explanation / Answer

Please donot provide links on chegg portal as it against chegg policy istead you can provide data here only

Thanking You

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote