How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask R.R. Jha Your Own Question

R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5467
Experience:  B.Tech
20870358
Type Your Homework Question Here...
R.R. Jha is online now
A new question is answered every 9 seconds

Excel 2010 Visual Basic Homework Help Problem 1: Hurricanes

Resolved Question:

Excel 2010 Visual Basic Homework Help

Problem 1:
Hurricanes are categorized based on wind speeds. Use the following table to write a (VB) script that will prompt the user for the wind speed, and will print the hurricane category number and the typical storm surge.

Category Wind Speed Storm Surge (in ft. above normal)
1 74-95 4-5
2 96-110 6-8
3 111-130 9-12
4 131-155 13-18
5 >155 >18

Problem 2:
Write the program in (VB) of a temperature conversion (temperature input in K to a temperature output in °C or °F). The inputs are: input1 is a number, input2 is a letter that is either "C" or "F" to represent Celsius and Fahrenheit, respectively. Deal with the possibility when the user gives the second input in small letter, or an invalid temperature unit. Also, consider when the user gives a negative number for input1!

Celsius= Kelvin -273 Fahrenheit = (Kelvin-273)*1.8+32

Problem 3:
Write a program in (VB) to determine if a given integer input: intYear, is a leap year or not.

Hint: For #3, use the built-in function mod in VB.

Pseudocode to determine whether a year is a leap year or not in either the Gregorian calendar since 1582 or in the proleptic Gregorian calendar between 1 and 1582:

if year is divisible by 400 then
is_leap_year
else if year is divisible by 100 then
not_leap_year
else if year is divisible by 4 then
is_leap_year
else
not_leap_year
Submitted: 1 year ago.
Category: Homework
Expert:  R.R. Jha replied 1 year ago.
Hi,

I'd be glad to help. I'll work over this and get back to you by tomorrow.


Thanks
Customer: replied 1 year ago.

Sure.

Expert:  R.R. Jha replied 1 year ago.
Ok, thanks
Customer: replied 1 year ago.

Hello, just seeing how things are going.

Expert:  R.R. Jha replied 1 year ago.
Hi,

It is ready. Please download file below

https://www.box.com/s/680pupys9yi8trhi1wl8


Please leave a rating for the answer.

It was time taking, bonus is appreciated.

Let me know when you need help with other problems. Just add 'RRJha' at the start of your new question to send it directly to me.

Thanks
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5467
Experience: B.Tech
R.R. Jha and 12 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

Hello, i just have q quick question for you. Are you familiar with a program called MatLab? I have some programming questions in that software.

Expert:  R.R. Jha replied 1 year ago.
Hi,

I'm familiar with Matlab. Let me know how I could help.
Customer: replied 1 year ago.

Ok, here are two problems. Take a look at them and see if you can help. If you can I would need them around 12:00 central time tommorrow and we can negotiate a price. Thanks.


 


1. Write the program in Matlab and Excel Visual Basic:


The distance between any two points (X1,Y1) and (X2,Y2) is give by,



distance = squareroot((x1-x2)^2+(y1+y2)^2)



the area of a triangle is ,



area = squareroot(S*(S-A)*(S-B)*(S-C))



where A,B, and C are the lengths of the sides of the triangle, and S is equal to half of the sum of the three sides of the triangle. Write a script that will prompt the user to enter the coordinates of the three points that determine a triangle ( the X and Y coordinates of each point). The script will then calculate and print the area of the triangle. it will call one function to calculate the area of the triangle. This function will call a sub-function that calculates the length of the side formed by any two points (the distance between them).


 


 


2. Create in programming language of your choice a function called isLeapYear(intYear) that determines if the input year is a leap year or not. Write the main program to calculate the total days passed in a year for a given date. Prompt the user for the (integer) inputs: year, month, and day. The output is the total days passed since Jan 1st of that year excluding the input date (e.g., if the user gives 2012, 01, 23, then the output is 22). Call the function isLeapYear(intYear) to determine if the year is leap or not, if necessary.


Assumption: The user is intelligent enough to enter valid dates only. Example of invalid dates (yyyy/mm/dd): 2001/01/32, 2002/02/29 (2002 is non-leap), 2005/04/31 (April has only 30 days), etc. Tackling invalid dates is for Project #1. However, if you insist to deal with invalid dates in this HW, it will worth maximum 10 extra pts, by creating another function to check the validity of the input date before calculating the total days passed. Name the function isValidDate(intYear, intMonth, intDay).


For checking: Use built-in function DateDiff in VB to check your work. Note that the function DateDiff must be used for checking ONLY.


Expected I/O:
Enter year: 2012
Enter month: 3
Enter day: 15


Total day passed in 2012 before 3/15 = 74 days

Expert:  R.R. Jha replied 1 year ago.
Hi Cody,

Could you please clarify which programming language these need to be in? Because first one states Matlab and Visual Basic, while second one says programming language of your choice?
Customer: replied 1 year ago.

Yes, the first question wants the programming language in both VB and Matlab. The second one can be in either VB or Matlab but if you could do it in Matlab would work best for me. Anything else you need to know?

Expert:  R.R. Jha replied 1 year ago.
Ok, I could do that. Let me know if you could add $40 bonus for all three program.
Customer: replied 1 year ago.

So, would i need to rehire you for 40 and pay a 40 bonus? Are you going to do the extra credit in the second question?

Expert:  R.R. Jha replied 1 year ago.
Yes, I would be doing extra credit one as well.
Customer: replied 1 year ago.

Ok. Sounds good to me.

Expert:  R.R. Jha replied 1 year ago.
Ok, then. I'll have them ready by tomorrow.
Customer: replied 1 year ago.

Ok, can i pay you tomorrow as well?

Expert:  R.R. Jha replied 1 year ago.
Sure, no problem. I'll post answer here which you rate and add bonus on.
Customer: replied 1 year ago.

Ok. Will do.

Customer: replied 1 year ago.

Hello, I'm just checking how things are going.


 


I know I posted my question Tuesday saying I needed it tomorrow (Wednesday) around noon central time. By the end of our conversation it was Wednesday (today) and I am just trying to confirm the date of which I need the assignment. I can have it as late as 3Pm central or 4pm EST today.


 


Sorry if I confused you but hopefully you understood my original time request. Thanks

Expert:  R.R. Jha replied 1 year ago.
Hi,

It's ready. Please download file below

https://www.box.com/s/rpegori4flpq4vgh8iqj

Thanks in advance for the rating and bonus.

Let me know anytime you need help with any other problems.

You can request me by adding 'RRJha' at the start of your new question.

Thanks
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5467
Experience: B.Tech
R.R. Jha and 12 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

Ok, thanks for the help. I don't have matlab on my computer and must go on campus to test the program. I will get back to you in a few hours and let you know how it goes. I will talk to you soon.

Expert:  R.R. Jha replied 1 year ago.
Ok
Customer: replied 1 year ago.

ok, i am having some errors with the coding.

 

For question one in VB and Matlab sometimes it tells me the area of the triangle is zero which cant be true.

 

What can i do to correct this?

 

Thanks

 

Expert:  R.R. Jha replied 1 year ago.
It can happen if the points are collinear, that is, all three points are in a straight line. Please make sure it isn't so. Here is an online calculator I found to cross check with

http://www.gottfriedville.net/mathtools/triarea.html
Customer: replied 1 year ago.

Ok, that makes much more sense. Thanks for your help and I might have some more for you tomorrow.


 


Your awesome, btw just 40 for the work?

Expert:  R.R. Jha replied 1 year ago.
Most welcome! You can add Bonus to make up as we discussed earlier.

Thanks
Customer: replied 1 year ago.

Ok, I got you taken care of. I will talk to you tomorrow.

Expert:  R.R. Jha replied 1 year ago.
Thank you, XXXXX XXXXX
Customer: replied 1 year ago.

Hello, I have some more things I could use some help on. I would need this by Friday around 5pm EST. I would like to know what you think.


 


Problem 1) Write the following code in Matlab and VB:



Hints: VB: Left, Right, InStr, Replace;


Matlab: strfind, strtok, strrep


 


Words in a sentence variable (just a string variable) called mysent are separated by right slashes (/) instead of blank spaces. For example, mysent might have this value:


'This/is/not/quite/right'


 


Write a function slashtoblank that will receive a string in this form and will return a string in which the words are separated by blank spaces. This should be general and work regardless of the value of the argument. No loops are allowed in this function; the built in string functions must be used.


>> mysent = 'This/is/not/quite/right';


>> newsent = slashtoblank(mysent)


newsent =


This is not quite right


 


Problem 2) With yesterdays homework you helped me with convert problem 2 to VB (you did that in Matlab) and by altering both the VB and Matlab code by,


 


2.1) By employing array vector in VB or a vector matrix in Matlab.


 


AND


 


2.2) By having Inout/Output as one line of string, with expected I/O:


Enter date: 2012/03/15


Total day passed in 2012 before 3/15 = 74 days

Expert:  R.R. Jha replied 1 year ago.
Ok, I'll work over these and Let you know.
Customer: replied 1 year ago.

Ok

Expert:  R.R. Jha replied 1 year ago.
Hi Cody,

Your next set of answer is ready. Please download file below

https://app.box.com/s/1vjygi0bnii5zpxkqtnl


Thanks in advance for rating and bonus.

Let me know if I could offer any further help.

Thanks
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5467
Experience: B.Tech
R.R. Jha and 12 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

Hello, I have some more work for you if your interested. I would need them by tommorrow night (Tuesday) before midnight 12:00 AM EST.


 


Question 1) Write the following program in MATLAB.


 


For a bio-medical experiment, the names and weights of some patients have been stored in a file named patwts.dat. For example, the file might look like this:


 


Darby George 166.2


Helen Dee 143.5


Giovanni Lupa 192.4


Cat Donovan 215.1


 


Create this data file first. Then, write a script readpatwts that will first attempt to open the file. If the file open is not successful, an error message should be printed. If it is successful, the script will read the data into strings, one line at a time. Print for each person the name in the form 'last,first' followed by the weight. Also, calculate and print the average weight. Finally, print whether the file close was successful. For example the results of running the script would look like this:


 


>> readpatwts



George,Darby 166.2


Dee,Helen 143.5


Lupa,Giovanni 192.4


Donovan,Cat 215.1


The average weight is 179.30


File close successful



Question 2)


Write the program in Matlab and VB, to calculate a root of a given formula and two initial conditions using Modified Secant method. In the program:


2.1. The formula should be given by the user as a string. Use the built-in function eval in Matlab, or Evaluate in VB to calculate the string expression.


2.2. Save the information in an output file for Matlab, printed to worksheet for VB, with the following format:(with [xxx] is the inputs from the user for each prompt)


=======================================================


Formula:


y = f(x) = [formula with x as independent variable]


Initial conditions:


a = [value of a]; f(a) = [value of f(a)]


b = [value of b]; f(b) = [value of f(b)]


Root:


x0 = [root of the problem]


y0 = [value of f(x0)]


====================================================


 

Expert:  R.R. Jha replied 1 year ago.
Received the files. I hope you'd be able to add $40 as bonus. I'll send them before midnight tomorrow.


Thanks
Customer: replied 1 year ago.

Sure, not a problem.

Expert:  R.R. Jha replied 1 year ago.
Ok, thanks.
Expert:  R.R. Jha replied 1 year ago.
Just noticed that Question 2 is inputting two initial condition but Modified Secant method uses only one initial condition (but Secant method uses two). Let me know which one to program for question 2.
Customer: replied 1 year ago.

Use the secant method so you can input two initial conditions.

Expert:  R.R. Jha replied 1 year ago.
Ok.
Expert:  R.R. Jha replied 1 year ago.
Please download it below

https://app.box.com/s/nm57sj8xi61ty3wo1tqv


Thanks
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5467
Experience: B.Tech
R.R. Jha and 12 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

Hello, thanks for the on time delivery. I just have some general questions over the software. Can you give me a brief lesson on how to use/run these programs and how they work?


 


Once again, thanks for your help.

Expert:  R.R. Jha replied 1 year ago.
For matlab scripts

http://ctms.engin.umich.edu/CTMS/index.php?aux=Extras_Mfile

For vba script, just open the file and click the button. It would call the script it's bound to.

Thanks
Customer: replied 1 year ago.

Hello, I have one more assignment for you. It involves creating a GUI in Visual Basic. I will receive extra credit for creating the same GUI in Matlab. Take a look at the parameters below an when do you think you have this done?

 

1. Write a GUI program in Visual Basic to calculate the time elapsed in between two specified instances to mimic VB’s (limited) DateDiff function.

 

2. Prompt the user two inputs of time instances in the format of:

Inputs:GUI example

Year: [in text box format]

Month: [in combo box or option button format]

Day: [in combo box format]

Hour: [in combo box or option button format]

Minute: [in combo box format]

Second: [in combo box format]

 

And a choice of time difference type:

Difference type: [in combo box or option button format with choices: Year, Month, Day, Hour, Minute, Second]

 

[Button: Calculate]

[Button: Close form]

 

Output(s):

[Label: Time difference = {#} {unit asked from Difference type}]

Optional: [Label: Time difference using DateDiff function = {#} {unit asked from Difference type}]

 

The only difference between your program and DateDiff is that in your program you have to deal with input where Time 1 > Time 2, while DateDiff gives negative number for the result.

 

3. 1 year = 366 days in leap year, otherwise 365 days. Inputs are limited between 2001/01/01 00:00:00 to 2999/12/31 23:59:59

 

4. Use the functions to determine leap year and determine days passed within a year in previous assignments to calculate the total days between the two dates.

 

5. Program should be written based on the materials that have been covered in the class: See below;

Coding/Matlab/Visual Basic

Input/Output

input, fprintf, disp, load, save

InputBox, Msgbox

Branching

if-elseif-else, case

If-ElseIf-Else, Case, Goto

Looping

for, while

For, Do While, Do Until

Function

Function

Function or Procedure

Built-In Function

String manipulation functions. EXCLUDE: Time/Date built-in functions.

GUI

All GUI controls and form

 

6. Result Check

Visual Basic: DateDiff.

Matlab: Help > date and time function.

Any Time/Date built-in functions are just to check the result of your program! NOT to be part of your program.

 

 

 

 

 

 

 

Expert:  R.R. Jha replied 1 year ago.
Hi Cody,

I could do this in Matlab. I should be able to finish it by Sunday, but let me know if it's due later. Hope you could add $50 as bonus, as this is bigger project.

Thanks
Customer: replied 1 year ago.

Well, if you can get it to me Tuesday would be great. Can you do both visual basic and matlab?

Expert:  R.R. Jha replied 1 year ago.
Ok, I'll send it before Tuesday. I can do them in both VB 2010 and Matlab, but that would be lots of work. If you're fine with adding $120 as bonus, I'd do them in both languages.
Customer: replied 1 year ago.

Ok, thats not a problem.

Expert:  R.R. Jha replied 1 year ago.
Alright then. I'll send both programs to you by Tuesday. I hope you already have Microsoft Visual Basic 2010 and Matlab on your system.
Customer: replied 1 year ago.

I do.

Expert:  R.R. Jha replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying MX$50.
If you've already paid for this answer, simply Login.
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5467
Experience: B.Tech
R.R. Jha and 12 other Homework Specialists are ready to help you
Expert:  R.R. Jha replied 1 year ago.
Hi there,

Were you able to retrieve the files?


Thanks
Customer: replied 1 year ago.

I will look it over today. Ive been a little busy lately. I will let you know how it works for me later today.

Expert:  R.R. Jha replied 1 year ago.
Ok, I'd look forward. I hope we could wrap it up by today itself, as it's end of the month :)

Thanks
Customer: replied 1 year ago.

Hello, I downloaded the files. I have some questions.


 


The matlab program works great!


 


How do i get the excel program to work?Do i need to save all of the files in the excel vb folder?

Expert:  R.R. Jha replied 1 year ago.
That one needs Visual Basic 2010. You can download it for free from

go.microsoft.com/?linkid=9709929
Customer: replied 1 year ago.

ok, i downloaded the visual basic from the link.


 


Now what do i need to do to get it to run? Tell me step by step please.

Expert:  R.R. Jha replied 1 year ago.
Install visual basic, extract the visual basic project folder I sent, and open file daysPassed.sln. Once opened, press F5 to run the project.
Customer: replied 1 year ago.

Ok, thank you for your help. The programs run fine now. I will be looking over the actual programming in more detail over the next day or so and if i have any questions ill be sure to ask you.


 


Thanks

Expert:  R.R. Jha replied 1 year ago.
You're most welcome!

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience
 
 
 

Related Homework Questions