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 ATLPROG Your Own Question

ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
44910485
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

A fairly simple function is required that will obtain a file

Customer Question

A fairly simple function is required that will obtain a file name (using pickAFile), and then recognise if it is a picture or a sound file, or even some other file type. The file should then be interpreted as either a picture if its type is jpg (then print an appropriate message, then exit), or a sound if its type is wav (then print an appropriate message, then exit), and if it is neither a picture nor a sound file, then an error message must be printed. This error message should include the type of the file (or the lack of a type, e.g. a file name that might not have a period in it, e.g. ducksjpg).
JA: OK. To minimize me, please click the down arrow at the top right corner of this box.
Customer: How do I complete this?? I have to finish this by tomorrow but I suck at programming
JA: What programs and versions are you using?
Customer: JES
JA: What is your ideal outcome? How can we solve this for you?
Customer: This is basically suppose to be the outcome >>> openSoundOrPicture()
Oops! Did not choose a picture or a sound file.
Type is: html
JA: Anything else you want the programmer to know before I connect you?
Customer: yes
Submitted: 16 days ago.
Category: Programming
Expert:  Bhavik Joshi replied 16 days ago.

Hi, I'm Bhavik. Welcome to JustAnswer. I'm reviewing your question now, and will reply back ASAP.

Expert:  Bhavik Joshi replied 16 days ago.

In which programing language this codes needs to be written ?

Expert:  Steve replied 16 days ago.

Hey there, my name is***** you still need this done?

Expert:  Bruce Wilner replied 13 days ago.

There's already a tool out there that will do this. It's called a Web browser.

Expert:  Bruce Wilner replied 13 days ago.

Oh, by the '>>>' I presume you want a Python function. You might have specified that.

Expert:  Bruce Wilner replied 13 days ago.

"Type is: html" is expecting WAY too much--unless that's just a boneheaded "check the suffix and report that as the 'file type' in absence of contradictory data." Of course, I could have a JPG file that is NAMED such-and-such dot cpp, for example. Did you want to DETECT FILE FORMATS or just recognize suffixes?

Related Programming Questions