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

Complete the mid-term Q1-3 Q1: \'Question 1. Sub DeclareVariables() \' Declare t

ID: 3601479 • Letter: C

Question

Complete the mid-term Q1-3

Q1:

'Question 1.
Sub DeclareVariables()
' Declare the following types of variable:
' Integer
' String
' Range
' Array
' A user-defined data-type called ClinicalStudy that consists of the following data elements:-
' Study Identification: is a 10 digit number that serially identify each study in the system.
' study Organization: a set of alphanumeric characters that identifies the company that owns the study.
' study Site: a set of alphanumeric characters that identifies where the study was conducted.
' Study Participant: a number that shows how many people participated in the study. This number can run into millions in the US where the study was conducted.
' Study Start Date: The date the study started
' Study Budget: the dollar amount allocated to the study.
  
' How do you ensure that variables used in a VBA program are declared?
End Sub

Q2:

'Question 2.
Sub WorkBookObjects()
'Given the following two VBA statements and the data in the 'Data' worksheet,
' What values would be the value of a variable strName if each of the following ranges are assigned to it?
Range("A1").Cells(9, 1).Value
Range("A1").Offset(9, 1).Value
Range("E12").Cells(3, -3).Value
Range("E12").Offset(-3, -3).Value
End Sub

Q3:

'Question 3.
Sub WorkBookObjects2()
'Given the data in the 'Data' worksheet,Write VBA statement to do the following:
' set the value of Cell E16 to 10% of the value in B16.
' change the color of E16 to RED if the value is > 78, otherwise set the color to BLUE

' List three (3) esssential concepts about VBA objects.
End Sub

Excel File:

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

Explanation / Answer

Q no 1

// inlcude header file

#include<iostream.h>
#include<conio.h>

// In main function declare the variable
void main()
{
int i,age;
char name[20]; // use the charachter array to store the name
// with the help of string.h
// we declare the string.

int array[20];

//to store the array element of type integer in continues memory location

// take the input of these variable

cout<<"enter age:";

cin>>age;

cout<<" enter name:";

cin>>name;

// for input the array we use for loop

for(i=0;i<20;i++)

{

cin>>a[i];

}

getch();

}

user defined data type

user defined data tyes are of two tyes class and structures are the example of user defined data types.

syntax of structures:

struct keyword is used to declare a structre.

struct clinical_study

{

int identification;

char organisation[20];

char site[20];

int participant;

char start_date[20];

double budget;

}s; // s is the object of structre

syntax of classes:

class keyword is used to declare a class.

class clinical_study

{

public: // scope resolution

int identification;

char organisation[20];

char site[20];

int participant;

char start_date[20];

double budget;

};

void main()

{

clinical_study c; // object is declared in main function

getch();

}

Q no 2

syntax :

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