Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

Homework

Goals: Developing problem-solving skills, declaring

Customer Question
variables, multi-way branches, employing loops...
Goals: Developing problem-solving skills, declaring variables, multi-way branches, employing loops, and using files Problem: You are to create a program to help in the analysis of data obtained from an x-ray powder diffractometer used to characterize materials.
In the diffractometer a sample is exposed to x-rays of a specific wavelength and a detector placed on a goniometer is used to measure the angles (2-theta values) where constructive interference of the diffracted beam occur (called peaks) and the intensity
of these peaks. The location of these peaks is dependent on the atomic structure of the material being examined. This relationship is given by Bragg’s law which states n = 2dsin() where n is the harmonic of the diffracted beam (n = 1 for these experiments),
 is the wavelength of the x-ray, d is the interplanar spacing between planes of specific orientation in the material and  (theta) is the angle between the x-ray beam and the sample of the material. You are to create a program that will read the 2-theta values
and the intensities from a file and create a table that will contain the 2-theta values, the intensities, the d values and Q values where Q = 1/(sin())2. The first line of the data file will contain the sample name which should be stored as a string object.
The second line will contain the anode (the elemental source of the x-ray) as a 2-character symbol which should also be stored as a string object. You will need to use this symbol to determine the wavelength of the x-ray using the table below. You should assume
the format of the 2-character symbol will be an upper case letter followed by a lower case letter and the symbol will be one of those listed in the table below. Anode Wavelength Cu 1.54059 Cr 2.28973 Fe 1.93604 Co 1.78900 Mo 0.70932 The 2-theta (first column)
and intensity values (second column) will start on the third line and continue on subsequent lines. The intensity values are whole numbers. You should design your program so it will continue to read data until the end of file is reached. Your output should
be a file that contains the name of the sample, the wavelength and a table containing the 2-theta and intensity values from the file plus the calculated d and Q values. The wavelength should be output with 6 significant digits, the 2-theta values with 5 significant
digits, the d values with 6 significant digits and the Q values with 7 significant digits. The table that you output should contain column headings then the values similar to the example given below. Your program should allow the user to enter the name of
the data file, but you do not need to worry about the folder path (assume the data file is in the same folder as your *.cpp file) and the name of the output file to be generated. A data file called “Project2data.dat” has been placed on ANGEL. This file contains
different peaks than what is shown in the table below. Your program should also allow the user to analyze data from another file without rerunning the program. For sample Project 2 demo with anode of Cu and wavelength of 1.54059 the values are 2-theta Intensity
d values Q values 16.375 20 5.40889 49.30620 20.845 55 4.25800 30.55609 26.622 100 3.34567 18.86480 33.097 45 2.70443 12.32647 36.520 5 2.45842 10.18587 39.439 21 2.28293 8.783553 40.263 34 2.23809 8.441890 There were 7 peaks in the file. Would you like to
analyze data from another file (y/n)? Do not use any concepts beyond Chapter 5 (e.g. do not use functions or arrays) to complete this project. Attach your source code file and your output file to the same submission on ANGEL. Make sure that you have included
your introductory comments containing the purpose of the program i.e. what problem or task is being solved plus the input needed from user to complete the problem/task, output expected from the program, and the processing needed to get the output from the
input. The description of the purpose should be detailed enough that a person reading your code would not need any additional information to understand the problem. The processing comments should not include any C++ commands.
Submitted: 2 years ago.Category: Homework
Show More
Show Less
Ask Your Own Homework Question
Answered in 1 hour by:
10/19/2015
Tutor: active1065, Engineer replied 2 years ago
active1065
active1065, Engineer
Category: Homework
Satisfied Customers: 331
Experience: Several years of experience in C# ,ASP.NET,PHP,C,C ++,SQL
Verified

Hi,

Welcome to Justanswer.

When do you need this by ? DO you have the sample input files for the project

Ask Your Own Homework Question
Customer reply replied 2 years ago
hi, I need it by Wednesday morning. I can email you the sample input, it is not allowing me to upload it here .
thanks for the help ,
-A
Tutor: active1065, Engineer replied 2 years ago

You can use the paperclip icon to add attachments. Use a word doc as your input.

Else go to www.wikisend.com and upload your file. It will give you a download link. Paste the link back here.

Ask Your Own Homework Question
Customer reply replied 2 years ago
hi the link http://wikisend.com/download/933856/Project2data.dat
Tutor: active1065, Engineer replied 2 years ago

This is something similar to i have done before. You can use this code to run and test your program:

http://pastebin.com/3L2nUkBf

Please don't forget to rate the service.

Regards,

Paul

Ask Your Own Homework Question
Customer reply replied 2 years ago
Dear *****
the program did not work , it is due in 2 hours I still cant see to get it working
i have pasted the Date file belowSample XBN-2
Cr
12.002 35
13.867 10
19.659 5
23.095 17
24.137 21
27.942 33
30.507 100
31.320 78
34.398 95
36.556 45
39.928 1
41.842 6
42.464 34
44.882 3
46.631 67
47.202 2
49.438 88
51.067 57
51.602 46
53.702 22
55.241 51
57.745 34
59.214 10
59.699 7
61.614 13
63.028 23
63.496 41
65.347 27
66.718 25
67.172 2
68.972 18
70.308 42
72.510 24
73.818 16
74.253 5
75.980 9
77.268 12
77.695 19
80.671 3
81.094 11
82.780 18
84.041 7
86.136 35
87.390 4
87.808 8
89.479 9
90.731 11
91.149 2
92.819 1
94.074 16
94.493 10
96.170 22
97.431 6
99.542 2
100.814 8
101.239 11
102.947 18
104.236 2
104.667 1
106.400 9
107.710 14
108.149 2
109.915 8
111.253 9
113.511 19
114.884 2
115.345 4
117.207 7
118.624 1
121.031 5
122.504 12
123.000 3
125.014 6
126.558 7
129.203 2
130.839 8
131.393 1
133.659 2
135.416 7
136.013 2
please check and resend as soon as possible,
thank you very much
Tutor: active1065, Engineer replied 2 years ago

I can see the output. Are you entering the file names properly?

Ask Your Own Homework Question
Tutor: active1065, Engineer replied 2 years ago

Enter the full input file name for e.g input.txt

Ask Your Own Homework Question
Ask Scott Your Own Question
Scott
Scott
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3,040
3,040 Satisfied Customers
Experience: MIT Graduate (Math, Programming, Science, and Music)

Scott is online now

A new question is answered every 9 seconds

How JustAnswer works:

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

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

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!!!!

AlexLos 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.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, 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.

EstherWoodstock, 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.

RobinElkton, 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.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

5,731 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,551 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,636 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,161 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
5 - 5 x 5 +5. What is the answer to 5 - 5 x 5 + 5? Only that
no, only that two people using order of operations keeps getting different answers… read more
GLENN
GLENN
Master of Mathematics
339 satisfied customers
Only for F.Naz Tutor. Kindly help with a research report,
Only for F.Naz Tutor.Kindly help with a research report, the links is http://www.mediafire.com/file/bmcea6dt278nw8w/report.txt… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
If I did not look at the description which says 4 cpu cores
if I did not look at the description which says 4 cpu cores and 6 gpu core to make TEN I wonder if you can bundle the two to make an advertisement that says 10 core I also have others in the same fiel… read more
Pete
Pete
Engineer
Bachelor\u0027s Degree
1,123 satisfied customers
Below is the Sketch of the improved parking lot from 36
Below is the Sketch of the improved parking lot from 36 available parking spaces to 51 total parking spaces with 15 newly added parking spaces. The design was 4 rows were made from previously 3 rows. … read more
GLENN
GLENN
Master of Mathematics
339 satisfied customers
1. You've formatted the first paragraph of a document. What
1. You've formatted the first paragraph of a document. What button can you use to apply the formatting from the first paragraph to the next paragraph in the document? A. Cut B. Paste C. Copy D. Format… read more
Cher
Cher
JustAnswer Expert & Mentor;Teacher/Tutor
Masters Degree
1,381 satisfied customers
Question 3 of 20: Select the best answer for the question.
Question 3 of 20 : Select the best answer for the question. 3. Circular errors are caused by adding the cell name of a/an _______ cell to a formula. A. adjacent B. absolute C. active D. relativeQuesti… read more
Chris M.
Chris M.
M.S.W. Social Work
Master's Degree
2,636 satisfied customers
Are u able to help me do this question in raptor The Dash
are u able to help me do this question in raptorThe Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as follows: l The first 60 messag… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,731 satisfied customers
I need to do a research project for school. I want to see if
I need to do a research project for school. I want to see if motor proteins will carry their cargo to its destination under different conditions; different drugs. If they do in what condition is the c… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
I am attempting to do a netbeans java assignment and need
I am attempting to do a netbeans java assignment and need help implementing the overridden method… read more
Ingo U
Ingo U
Master\u0027s Degree
357 satisfied customers
This assignment is due by next Tuesday by midnight. Is this
Hello David! This assignment is due by next Tuesday by midnight. Is this a good amount of time for you?Complete the following questions in an MS Word Document in APA format. Double space your work and… read more
David L.
David L.
Bachelor\u0027s Degree
6 satisfied customers
NOTE: This question is a homework given by the same
NOTE: This question is a homework given by the same professor. It does not violate any honor code because same question is repeatedly asked different students. DO NOT FLAGCase Study #1: Technology & P… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
Exam Number: 584001RR Lesson Name: Microsoft Word 2016 1.
Exam Number: 584001RR Lesson Name: Microsoft Word 2016 1. Add a _______ to manually force text from one page to the next page. A. header B. blank page C. footer D. page break2. Tab stops are very usef… read more
Chris M.
Chris M.
M.S.W. Social Work
Master's Degree
2,636 satisfied customers
Penn college need answer now plz Microsoft Word 2016 1. Font
Penn foster college need answer now plz Microsoft Word 2016 1. Font size, font style, and _______ are all aspects of character formatting. A. typeface B. indentation C. line spacing. D. alignment 2. W… read more
GLENN
GLENN
Master of Mathematics
339 satisfied customers
Adrianna, a local retired music teacher and amateur concert
Adrianna, a local retired music teacher and amateur concert violinist, has recently died. Her will contains the following provisions: (i) £150,000 on trust to be shared equally between those pupils to… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
When Boyajian purchased her home in Yosemite Sky Park, a
When Boyajian purchased her home in Yosemite Sky Park, a residential subdivision created for owners of small airplanes, the deed transferring title from San Joaquin Development Corporation to her incl… read more
Steven, M.Acc.
Steven, M.Acc.
Instructor
Master\u0027s Degree
252 satisfied customers
Ovid owned 40 acres of timberland in the mountains just east
Ovid owned 40 acres of timberland in the mountains just east of La Sierra State Park. His property began at the western terminus of County Road 69. He used the property for camping and fishing, and bu… read more
Steven, M.Acc.
Steven, M.Acc.
Instructor
Master\u0027s Degree
252 satisfied customers
I didn't pass 2 exams for penn human relations an I need
I didn't pass 2 exams for penn foster human relations an I need help … read more
GLENN
GLENN
Master of Mathematics
339 satisfied customers
8. In spite of the difficulties that ABC... 8. In spite of
8. In spite of the difficulties that ABC... 8. In spite of the difficulties that ABC has caused the company, DEF still thinks that ABC makes the best gaskets in the world. Since the client doesn't wan… read more
Ray
Ray
Lawyer
Doctoral Degree
30,821 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x