Question: How do I write a script that requests the inputs from the user for each element and properly stores the elements instead using the struct

 How do I write a script that requests the inputs from

How do I write a script that requests the inputs from the user for each element and properly stores the elements instead using the struct function without me having to enter all the elements at once like above. I was thinking I could create a for loop for the first 18 elements that will request the element name, atomic number, chemical symbol, class, atomic weight, and a seven- element vector for the number of electrons in each shell and then store them in a structure

Elements ( 1 ) =struct ( ' Name ' , ' Hydrogen ' , ' Atomic-number ' , 1, ' Che mical_symbol', 'H','Class', Alkali metal','Atomic weight',1.008, Number_of_electrons', [10 00 0 0 ]) Elements (2)-struct('Name', 'Helium','Atomic number',2, 'Chemi cal_symbol''He','Class'Noble_gas''Atomic_weight',A.003 Number of electrons',12 0000 0 0]); Elements (3)-struct ('Name', 'Lithium', 'Atomic number',3, 'Chem ical_symbol', 'Li', 'class' Alkali_metal', 'Atomic_weight',6.941,'Number_of_electrons' [2 1 0 000 0]) Elements (4)-struct ('Name",Beryllium, 'Atomic number',4,'Ch emical symbol'Be''Class' Alkali Earth metal1''Atomic weight',9.012, 'Number of elec trons',12 2 000 0 0]) Elements ( 5) =struct ( ' Name ' , ' Sodium ' , ' Atomicnumber ' , 1 1 , ' Chem ical symbol', 'Na', 'Class' Alkali metal','Atomic weight',22.989, Number of electrons ,[28100001)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!