{"id":197396,"date":"2025-03-07T07:06:47","date_gmt":"2025-03-07T07:06:47","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=197396"},"modified":"2025-03-07T07:06:50","modified_gmt":"2025-03-07T07:06:50","slug":"a-telephone-company-charges-to-cents-per-minutefor-all-calls-outside-the-customers-area-code-that-last-over-20-minutes-7","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2025\/03\/07\/a-telephone-company-charges-to-cents-per-minutefor-all-calls-outside-the-customers-area-code-that-last-over-20-minutes-7\/","title":{"rendered":"A telephone company charges to cents per minutefor all calls outside the customers area code that last over 20 minutes"},"content":{"rendered":"\n<p>A telephone company charges to cents per minutefor all calls outside the customers area code that last over 20 minutes .All other calls are 13 percents minute.Fields for each call include customer area code (three digits),customer phone number (seven digits),called area code (three digits),called number(seven digits)and called time in minutes(four digits).Display the customer area code,customer phone number,called area code,called number,called time in minutes and the total charge.Draw the flowchart for this program.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-ast-global-color-6-color\"><strong>The correct answer and explanation is :<\/strong><\/mark><\/p>\n\n\n\n<p>To address the problem of calculating telephone charges based on call duration and area codes, we can design a program that processes each call&#8217;s details and computes the total charge accordingly.<\/p>\n\n\n\n<p><strong>Problem Breakdown:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Input Fields:<\/strong><\/li>\n\n\n\n<li>Customer Area Code (3 digits)<\/li>\n\n\n\n<li>Customer Phone Number (7 digits)<\/li>\n\n\n\n<li>Called Area Code (3 digits)<\/li>\n\n\n\n<li>Called Number (7 digits)<\/li>\n\n\n\n<li>Call Duration in Minutes (up to 4 digits)<\/li>\n\n\n\n<li><strong>Charging Rules:<\/strong><\/li>\n\n\n\n<li>Calls outside the customer&#8217;s area code lasting over 20 minutes are charged at 10 cents per minute.<\/li>\n\n\n\n<li>All other calls are charged at 13 cents per minute.<\/li>\n<\/ul>\n\n\n\n<p><strong>Steps to Solve:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Input Collection:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Prompt the user to enter the customer area code, customer phone number, called area code, called number, and call duration.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Charge Calculation:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If the call is outside the customer&#8217;s area code and lasts over 20 minutes:\n<ul class=\"wp-block-list\">\n<li>Calculate the charge as: <code>charge = call_duration * 0.10<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Otherwise:\n<ul class=\"wp-block-list\">\n<li>Calculate the charge as: <code>charge = call_duration * 0.13<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Output:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Display the customer area code, customer phone number, called area code, called number, call duration, and the total charge.<\/li>\n<\/ul>\n\n\n\n<p><strong>Pseudocode:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>START\n    \/\/ Declare variables\n    STRING customer_area_code, customer_phone_number, called_area_code, called_number\n    INTEGER call_duration\n    FLOAT charge\n\n    \/\/ Input data\n    PRINT \"Enter customer area code:\"\n    INPUT customer_area_code\n    PRINT \"Enter customer phone number:\"\n    INPUT customer_phone_number\n    PRINT \"Enter called area code:\"\n    INPUT called_area_code\n    PRINT \"Enter called number:\"\n    INPUT called_number\n    PRINT \"Enter call duration in minutes:\"\n    INPUT call_duration\n\n    \/\/ Calculate charge\n    IF customer_area_code != called_area_code AND call_duration &gt; 20 THEN\n        charge = call_duration * 0.10\n    ELSE\n        charge = call_duration * 0.13\n    ENDIF\n\n    \/\/ Output results\n    PRINT \"Customer Area Code: \", customer_area_code\n    PRINT \"Customer Phone Number: \", customer_phone_number\n    PRINT \"Called Area Code: \", called_area_code\n    PRINT \"Called Number: \", called_number\n    PRINT \"Call Duration (minutes): \", call_duration\n    PRINT \"Total Charge ($): \", charge\nSTOP<\/code><\/pre>\n\n\n\n<p><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Input Section:<\/strong> Collects necessary details about the call.<\/li>\n\n\n\n<li><strong>Charge Calculation:<\/strong> Determines the appropriate rate based on the area codes and call duration.<\/li>\n\n\n\n<li><strong>Output Section:<\/strong> Displays all relevant information, including the calculated charge.<\/li>\n<\/ul>\n\n\n\n<p><strong>Conclusion:<\/strong><\/p>\n\n\n\n<p>This approach ensures that each call is billed correctly based on the specified criteria. By following the outlined steps and utilizing the provided pseudocode, one can implement a program that accurately calculates telephone charges.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A telephone company charges to cents per minutefor all calls outside the customers area code that last over 20 minutes .All other calls are 13 percents minute.Fields for each call include customer area code (three digits),customer phone number (seven digits),called area code (three digits),called number(seven digits)and called time in minutes(four digits).Display the customer area code,customer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25],"tags":[],"class_list":["post-197396","post","type-post","status-publish","format-standard","hentry","category-exams-certification"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/197396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/comments?post=197396"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/197396\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=197396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=197396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=197396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}