Search for question
Question

Translated from Greek to English - www.onlinedoctranslator.com System Programming Deadline: 13.06.2024 1. Write a smart contract market.sol in Solidity where you will implement a simple market. The smart contract will have three methods: a) addProduct, b) listProducts, c) buyProduct. A product is a string name. The market (the smart contract) contains a "mapping (string=>address) products" with all products and their mapping to Ethereum addresses (accounts) representing their owners and a mapping(string=>int32) with all products and their prices. The addProduct method adds a product (string parameter) with a value (int32 parameter) and msg.sender (the caller of the function) is set as the owner. The listProducts method returns the list of products (string[]) and their values (int32[]). The buyProduct method takes the product (string) as a parameter, and if the money paid (msg.value) is greater than or equal to the product price, it pays the owner the product price and changes the owner of the product. Compile, deploy in Ganache and call the smart contract methods. Write a short report where you provide screenshots of the above steps and your method calls and how they change the market state and the balances in users' Ganache accounts. Help: Use one account as seller and one account as buyer and initially add only one product. Also, for transferring money, each address has a balance field, so to transfer amount x from account A to B you can do A.balance -=x? B.balance += x 2. Write in C a countlabels.c program that will use MPI to count the number of subjects carrying each different label. The data will be read from the accompanying file in eclass at the location Documents-code/data.zip, which contains almost 70 thousand lines of the form subject <TAB> tag, eg, 100000170 African American The purpose of your program, to be developed with MPI, is for a coordinator process to read the file and break its processing into multiple chunks, each of which will count the occurrence count of each different tag and produce pairs of "tag, crowd" for all the different tags it encountered, and it will send all of these to the moderator. The moderator reading the results should sum them by tag and display them on the screen, e.g. African American 156 Caucasian 342 Hispanic 235


Most Viewed Questions Of C/C++

Convert the following from mg/L as CaCO3 to mg/L as the ion or compound: (a) 125.00 mg/L as CaCO3 of CO2 For CO2, assume Z = 2 since dissolved CO2 is indistinguishable from H2CO3 (b) 125.0 mg/L as CaCO3 of Ca(OH)2 (c) 125.00 mg/L as CaCO3 of H3PO4 (d) 125 mg/L as CaCO3 of H2PO4 (e) 125 mg/Las CaCO3 of CI


The above graph shows the solubility of benzoic acid in water at different temperatures. You are provided with 1.0 g of very impure benzoic acid which is dissolved in water at 90 °C. After hotfiltration 0.2 g of the insoluble impurity was removed by hot filtration. The solution was allowed to cool,crystallization occurred and pure benzoic acid was collected by filtration. Calculate the maximum amount of benzoic acid that could be dissolved in 30 ml of water at90 °C. Calculate the yield of recovered material if complete crystallization occurred at 30 C.could this yield be improved?How What is the minimum amount of water that could be used in this exercise?If the temperature dropped from 90 °C to 70 °C on hot filtration what is the maximum If the temperature dropped from 90 °C to 70 °C on hot filtration what is the maximumamount of benzoic acid that could be lost on the filter paper. If 60 ml of water was used for the recrystallization, and the temperature dropped from 90to 70 Con filtration calculate the minimum recovery of pure material on crystallisation at30 °C.


1. Below are the structures of two complex lipids: (a) a glycolipid and (b) a sphingolipid. Would either of these compounds give you a positive test with molybdate solution? Explain your answer.


1. Use the average concentration of vitamin C from your data, and calculate the volume of fruit drink that would satisfy your minimum daily requirement of vitamin C.


9. The 'H-NMR spectrum of Compound A (C10H13NO2) is given below with integration indicated. When A is warmed with aqueous NaOH it yields an amine, Compound B(C3H11NO). The 'H-NMR spectrum of Compound B is almost identical to that of A except the signal at 2.1 ppm has disappeared and the broad signal at 7.9 ppm has moved to 3.4 ppm (also broad). When heated with HI the amine (Compound B) yields Compound C (C6H7NO) and its IR spectrum is shown below. Propose and draw structures of Compounds A, B, and C with rationale where appropriate. Consider the'H-NMR signal at 7.9 ppm in Compound A. Why does it appear at 3.4 ppm in Compound B. Explain why both signals are broad.


Balance the following redox reactions. It is recommended that you use balanced half reactions to proceed: \text { (a) } \mathrm{KMnO}_{4}+\mathrm{Fe} \mathrm{SO}_{4}+\mathrm{H}_{2} \mathrm{SO}_{4} \rightarrow \mathrm{Fe}^{3+}+\mathrm{K}_{2} \mathrm{SO}_{4}+\mathrm{MnSO}_{4}+\mathrm{H}_{2} \mathrm{O} \text { (b) } \mathrm{HClO} \rightarrow \mathrm{HClO}_{3}+\mathrm{HCl} \text { (c) } \mathrm{NO}_{2}^{-}+\mathrm{MnO}_{4}^{-}+\mathrm{H}^{+} \rightarrow \mathrm{NO}_{3}^{-}+\mathrm{Mn}^{2+}+\mathrm{H}_{2} \mathrm{O} \text { (d) } \mathrm{Cl}+\mathrm{NO}_{3}^{-}+\mathrm{H}^{+} \rightarrow \mathrm{Cl}_{2}+\mathrm{NO}+\mathrm{H}_{2} \mathrm{O} \text { (e) } \mathrm{l}_{2}+\mathrm{IO}_{3}^{-}+\mathrm{H}^{+}+\mathrm{Cl} \rightarrow \mathrm{ICl}_{2}^{-}+\mathrm{H}_{2} \mathrm{O}


a) Define and distinguish the terms stereoselective and stereospecific.12] Consider the following reaction sequence. b) Propose mechanisms for all steps of the sequence, indicating stereochemistry for the intermediates and final product.[5] c) State the optical rotation of the final product. For three of the following reactions, propose a mechanism


The following mineral analysis was reported for a water sample taken from Well No. 1 at the Eastwood Manor Subdivision near McHenry, Illinois. Note: All concentrations reported as "mg/Lof ion" unless stated otherwise. (a) Determine the unknown sodium concentration in mg/L of Na* using the electro neutrality condition. (b) Determine the total, carbonate, and non carbonate hardness in mg/L as CaCO3 using only the predominant polyvalent cation definition. Also construct the meg/L bar chart. (c) Calculate the total, carbonate, and non carbonate hardness in mg/L as CaCO3 using all the polyvalent cations. What is the percent error in using only the predominant cations?


Question 56 (0.0001 points) (5 marks) Hand write your answers to the questions below. Select the tickbox when you have completed this question. a. Label with asterisks (*) all of the stereocentres in the molecule shown above. (1 mark) b. How many stereoisomers are possible? (1 mark) c. Draw the structures of one pair of enantiomers for the above molecule. (Hint: You should draw two structures using wedge and dashed wedge bonds.) (3 marks)


Question 51 (0.0001 points) Saved (5 marks) Add bonds (double or triple bonds) and lone pairs to the following incomplete structure where required. Include all formal charges where appropriate. Hand write your answer. Select the tickbox when you have completed the question.