The concept of Function abstraction can be applied to the process of developing
ID: 3665870 • Letter: T
Question
The concept of Function abstraction can be applied to the process of developing programs. When writing a large program, you can use the "divide and conquer" strategy, also known as stepwise refinement, to decompose it into sub-problems. The sub problems can be further decomposed into smaller, more manageable problems. In this lab, we will use the Print Calendar example (discussed in class) to demonstrate the stepwise refinement approach. We will use the following design diagram: The following gives you the skeleton of your modular code. Bottom-up approach is to implement one Function in the structure chart at a time from the bottom to the top. For each Function implemented, write a test program to test it. As the implementation of all the functions in a header file and include the header file and use it to print the calendar of a specific month. Also, output your formatted calendar to a FILE (and NOT to the screen).Explanation / Answer
a)
There will be three component of electric field due to three charges.
Writting fields in vector form considering x axis to the right and y axis upward.
Field due to charge 2q, E2q = k.2q/a^2 i^
Field due to charge 4q, E4q = k.4q/a^2 j^
Field due to charge 3q, F3q = k.3q/(2sqrt(2)*a^2) (i^+j^)
so net Field will be E = kq/a^2*([2+3/2sqrt(2)] i^ + [4+3/2sqrt(2)] j^)
E = 3.06 kq/a^2 i^ + 5.06 kq/a^2 j^ N/C
b) The force on q will be F = qE
F = 3.06 kq^2/a^2 i^ + 5.06 kq^2/a^2 j^ N
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.